diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-05-07 19:41:59 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-05-07 19:41:59 (GMT) |
commit | 6efa50a384f61155cd5315cd32f0f8775fe124c5 (patch) | |
tree | 2cc831c060e953beb452ec4b33e199e2c06f25d9 /Lib/importlib/_bootstrap.py | |
parent | 943cab2fec8e7fb3232e72d9f1ca6535674e746a (diff) | |
download | cpython-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.py | 2 |
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: |