mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue 19944: Fix importlib.find_spec() so it imports parents as needed.
The function is also moved to importlib.util.
This commit is contained in:
parent
128ee220e2
commit
6029e08691
11 changed files with 292 additions and 230 deletions
|
@ -1,5 +1,6 @@
|
|||
import importlib
|
||||
import importlib.abc
|
||||
import importlib.util
|
||||
import os
|
||||
from platform import python_version
|
||||
import re
|
||||
|
@ -660,7 +661,7 @@ class EditorWindow(object):
|
|||
return
|
||||
# XXX Ought to insert current file's directory in front of path
|
||||
try:
|
||||
spec = importlib.find_spec(name)
|
||||
spec = importlib.util.find_spec(name)
|
||||
except (ValueError, ImportError) as msg:
|
||||
tkMessageBox.showerror("Import error", str(msg), parent=self.text)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue