summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-06-25 17:47:53 (GMT)
committerBrett Cannon <brett@python.org>2016-06-25 17:47:53 (GMT)
commite92dc9c23da8cb11f922f28353e6a58928aa5c71 (patch)
treee69b676b8236c0adde0f45fb2ee79c458771f178 /Lib/importlib
parent559ad5d401229399e7bc887b62a87d9f69206fa6 (diff)
downloadcpython-e92dc9c23da8cb11f922f28353e6a58928aa5c71.zip
cpython-e92dc9c23da8cb11f922f28353e6a58928aa5c71.tar.gz
cpython-e92dc9c23da8cb11f922f28353e6a58928aa5c71.tar.bz2
Fix a scoping issue where an UnboundLocalError was triggered if a
lazy-loaded module was already in sys.modules.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/importlib/util.py b/Lib/importlib/util.py
index 4525b3f..e1fa07a 100644
--- a/Lib/importlib/util.py
+++ b/Lib/importlib/util.py
@@ -241,7 +241,7 @@ class _LazyModule(types.ModuleType):
if id(self) != id(sys.modules[original_name]):
msg = ('module object for {!r} substituted in sys.modules '
'during a lazy load')
- raise ValueError(msg.format(original_name))
+ raise ValueError(msg.format(original_name))
# Update after loading since that's what would happen in an eager
# loading situation.
self.__dict__.update(attrs_updated)