-
-
Notifications
You must be signed in to change notification settings - Fork 252
Closed
Labels
Description
If the following code is typed very quickly after bpython-curtsies invocation, import completion has not yet finished, and bpython crashes:
$ bpython-curtsies
>>> import os
#!python
tom-mba:~ tomb$ bpython-curtsies
>>> import o
Traceback (most recent call last):
File "/usr/local/bin/bpython-curtsies", line 9, in <module>
load_entry_point('bpython==mercurial', 'console_scripts', 'bpython-curtsies')()
File "/Users/tomb/Dropbox/code/bpython/bpython/curtsies.py", line 51, in main
mainloop(config, locals_, banner, interp, paste)
File "/Users/tomb/Dropbox/code/bpython/bpython/curtsies.py", line 88, in mainloop
process_event(tc.get_event())
File "/Users/tomb/Dropbox/code/bpython/bpython/curtsies.py", line 67, in process_event
repl.process_event(e)
File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 335, in process_event
self.update_completion()
File "/Users/tomb/Dropbox/code/bpython/bpython/curtsiesfrontend/repl.py", line 450, in update_completion
self.list_win_visible = BpythonRepl.complete(self, tab)
File "/Users/tomb/Dropbox/code/bpython/bpython/repl.py", line 588, in complete
matches = importcompletion.complete(self.current_line(), cw)
File "/Users/tomb/Dropbox/code/bpython/bpython/importcompletion.py", line 77, in complete
for name in modules:
RuntimeError: Set changed size during iteration
tom-mba:~ tomb$
Import completion should happen in a coroutine instead of a thread, or there should be a lock around the import completion modules list that the import completion code gives up to allow keys to be pressed, or something.
- Bitbucket: https://bitbucket.org/bobf/bpython/issue/263
- Originally Reported By:
- Originally Created At: 2014-03-01T02:13:29.395
Reactions are currently unavailable