diff options
author | Brett Cannon <brett@python.org> | 2012-04-14 20:44:23 -0400 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-04-14 20:44:23 -0400 |
commit | 38305fabf45730d8d6065734c62aab82f35752b2 (patch) | |
tree | 72a8af42a6af3e9bbdf62565471004537318f064 | |
parent | b71ab8ba3fcf30ee5fd46870ad58aef7302ebd51 (diff) | |
download | cpython-38305fabf45730d8d6065734c62aab82f35752b2.tar.gz |
IDLE was relying on implicit relative imports which have gone away in
Python 3.3 thanks to importlib finishing the work in PEP 328 that
accidently got carried forward.
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 6a01db0125..de74e58c0f 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -1,8 +1,9 @@ -import sys +import imp +import importlib import os import re import string -import imp +import sys from tkinter import * import tkinter.simpledialog as tkSimpleDialog import tkinter.messagebox as tkMessageBox @@ -1005,7 +1006,10 @@ class EditorWindow(object): def load_extension(self, name): try: - mod = __import__(name, globals(), locals(), []) + try: + mod = importlib.import_module('.' + name, package=__package__) + except ImportError: + mod = importlib.import_module(name) except ImportError: print("\nFailed to import extension: ", name) raise |