[Python-checkins] cpython (3.4): Issue #16233: When the module browser is not invoked in an editor window with

terry.reedy python-checkins at python.org
Thu Oct 16 04:02:30 CEST 2014


https://hg.python.org/cpython/rev/dd3c0ea52106
changeset:   93089:dd3c0ea52106
branch:      3.4
parent:      93082:5fd481150b35
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Wed Oct 15 22:01:31 2014 -0400
summary:
  Issue #16233: When the module browser is not invoked in an editor window with
a filename, pop up the Open Module box. If a module is opened, open a
corresponding browser.

files:
  Lib/idlelib/EditorWindow.py |  13 ++++++-------
  1 files changed, 6 insertions(+), 7 deletions(-)


diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -689,16 +689,15 @@
             self.flist.open(file_path)
         else:
             self.io.loadfile(file_path)
+        return file_path
 
     def open_class_browser(self, event=None):
         filename = self.io.filename
-        if not filename:
-            tkMessageBox.showerror(
-                "No filename",
-                "This buffer has no associated filename",
-                master=self.text)
-            self.text.focus_set()
-            return None
+        if not (self.__class__.__name__ == 'PyShellEditorWindow'
+                and filename):
+            filename = self.open_module()
+            if filename is None:
+                return
         head, tail = os.path.split(filename)
         base, ext = os.path.splitext(tail)
         from idlelib import ClassBrowser

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list