diff options
Diffstat (limited to 'Lib/idlelib/PathBrowser.py')
-rw-r--r-- | Lib/idlelib/PathBrowser.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/idlelib/PathBrowser.py b/Lib/idlelib/PathBrowser.py index d88a48e..55bf1aa 100644 --- a/Lib/idlelib/PathBrowser.py +++ b/Lib/idlelib/PathBrowser.py @@ -1,6 +1,7 @@ import os import sys import imp +import importlib.machinery from idlelib.TreeWidget import TreeItem from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem @@ -70,9 +71,11 @@ class DirBrowserTreeItem(TreeItem): def listmodules(self, allnames): modules = {} - suffixes = imp.get_suffixes() + suffixes = importlib.machinery.EXTENSION_SUFFIXES[:] + suffixes += importlib.machinery.SOURCE_SUFFIXES[:] + suffixes += importlib.machinery.BYTECODE_SUFFIXES[:] sorted = [] - for suff, mode, flag in suffixes: + for suff in suffixes: i = -len(suff) for name in allnames[:]: normed_name = os.path.normcase(name) |