mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#18681: Fix a NameError in imp.reload() (noticed by Weizhao Li).
This commit is contained in:
parent
a9e67ad993
commit
056bafe7a6
3 changed files with 12 additions and 1 deletions
|
@ -267,7 +267,7 @@ def reload(module):
|
|||
parent_name = name.rpartition('.')[0]
|
||||
if parent_name and parent_name not in sys.modules:
|
||||
msg = "parent {!r} not in sys.modules"
|
||||
raise ImportError(msg.format(parentname), name=parent_name)
|
||||
raise ImportError(msg.format(parent_name), name=parent_name)
|
||||
return module.__loader__.load_module(name)
|
||||
finally:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue