---------- Forwarded message ----------
From: Aaron Rogers <[email protected]>
Date: 14 July 2015 at 05:17
Subject: bpython3 reimport
To: [email protected]
Hello sir,
bpython's reimport functions (F6) for python3 fails without
changing or re-running anything on my system while that function
works fine in bpython2. It appears as though repl.original_modules
shares a refference with sys.modules.keys() and so the comparison
in "clear_modules_and_reevaluate" is returning False always.
Included is a patch file, to show what I changed to make it work
and more importantly bring the issue to your attention.
Thank you
--
You received this message because you are subscribed to the Google Groups
"bpython" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/bpython.
For more options, visit https://groups.google.com/d/optout.
--- /usr/lib/python3.4/site-packages/bpython/curtsiesfrontend/repl.py 2015-03-02 06:22:47.000000000 -0700
+++ ./repl.py 2015-07-13 21:48:41.310384811 -0600
@@ -394,7 +394,7 @@
self.incremental_search_target = ''
- self.original_modules = sys.modules.keys()
+ self.original_modules = list(sys.modules.keys())
self.width = None
self.height = None
@@ -808,13 +808,13 @@
if self.watcher:
self.watcher.reset()
cursor, line = self.cursor_offset, self.current_line
- for modname in sys.modules.keys():
+ for modname in list(sys.modules.keys()):
if modname not in self.original_modules:
del sys.modules[modname]
self.reevaluate(insert_into_history=True)
self.cursor_offset, self.current_line = cursor, line
- self.status_bar.message(_('Reloaded at %s by user.') %
- (time.strftime('%X'), ))
+ self.status_bar.message(_('Reloaded at %s by user.' %
+ (time.strftime('%X'), )))
def toggle_file_watch(self):
if self.watcher: