diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2014-01-07 03:42:59 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2014-01-07 03:42:59 (GMT) |
commit | 02b9f9d6bb596d437ac10d71afac8a4781d18d86 (patch) | |
tree | 1193a4aa2a6b434eb4fc6bea0e561d32b5dafb80 /Lib/idlelib/EditorWindow.py | |
parent | 3a62d14b24843de4884ea8d0167bc1285b285a97 (diff) | |
download | cpython-02b9f9d6bb596d437ac10d71afac8a4781d18d86.zip cpython-02b9f9d6bb596d437ac10d71afac8a4781d18d86.tar.gz cpython-02b9f9d6bb596d437ac10d71afac8a4781d18d86.tar.bz2 |
Remove more usage of APIs deprecated by PEP 451.
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index eaf68cb..f855bc6 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -659,20 +659,20 @@ class EditorWindow(object): return # XXX Ought to insert current file's directory in front of path try: - loader = importlib.find_loader(name) + spec = importlib.find_spec(name) except (ValueError, ImportError) as msg: tkMessageBox.showerror("Import error", str(msg), parent=self.text) return - if loader is None: + if spec is None: tkMessageBox.showerror("Import error", "module not found", parent=self.text) return - if not isinstance(loader, importlib.abc.SourceLoader): + if not isinstance(spec.loader, importlib.abc.SourceLoader): tkMessageBox.showerror("Import error", "not a source-based module", parent=self.text) return try: - file_path = loader.get_filename(name) + file_path = spec.loader.get_filename(name) except AttributeError: tkMessageBox.showerror("Import error", "loader does not support get_filename", |