summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-05-07 19:41:59 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-05-07 19:41:59 (GMT)
commit6efa50a384f61155cd5315cd32f0f8775fe124c5 (patch)
tree2cc831c060e953beb452ec4b33e199e2c06f25d9 /Lib/importlib/_bootstrap.py
parent943cab2fec8e7fb3232e72d9f1ca6535674e746a (diff)
downloadcpython-6efa50a384f61155cd5315cd32f0f8775fe124c5.zip
cpython-6efa50a384f61155cd5315cd32f0f8775fe124c5.tar.gz
cpython-6efa50a384f61155cd5315cd32f0f8775fe124c5.tar.bz2
Issue #14583: Fix importlib bug when a package's __init__.py would first import one of its modules then raise an error.
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
-rw-r--r--Lib/importlib/_bootstrap.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 1e6a05a..9952b06 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -1082,7 +1082,7 @@ def __import__(name, globals={}, locals={}, fromlist=[], level=0):
# Return up to the first dot in 'name'. This is complicated by the fact
# that 'name' may be relative.
if level == 0:
- return sys.modules[name.partition('.')[0]]
+ return _gcd_import(name.partition('.')[0])
elif not name:
return module
else: