From: Terry Jan Reedy Date: Thu, 16 Oct 2014 02:01:31 +0000 (-0400) Subject: Issue #16233: When the module browser is not invoked in an editor window with X-Git-Tag: v3.4.3rc1~462 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=380ec63f23d2e76be9aec90493de174c6d01c2df;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index f43c9a1968a7..10565522f73d 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -689,16 +689,15 @@ class EditorWindow(object): 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