From d6bb65f378e34fe0c11fdb39588357ecf22964eb Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sat, 30 Sep 2017 19:54:28 -0400 Subject: bpo-31460: Simplify the API of IDLE's Module Browser. (#3842) Passing a widget instead of an flist with a root widget opens the option of creating a browser frame that is only part of a window. Passing a full file name instead of pieces assumed to come from a .py file opens the possibility of browsing python files that do not end in .py. --- Lib/idlelib/editor.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Lib/idlelib/editor.py') diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 5b16ccee8a..87d1eef01e 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -664,10 +664,8 @@ class EditorWindow(object): filename = self.open_module() if filename is None: return "break" - head, tail = os.path.split(filename) - base, ext = os.path.splitext(tail) from idlelib import browser - browser.ModuleBrowser(self.flist, base, [head]) + browser.ModuleBrowser(self.root, filename) return "break" def open_path_browser(self, event=None): -- cgit v1.2.1