mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
44590e4786
commit
aef82d3d1e
1 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue