summaryrefslogtreecommitdiffstats
path: root/Lib/imp.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/imp.py')
-rw-r--r--Lib/imp.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/imp.py b/Lib/imp.py
index 781ff23..866464b 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -203,8 +203,9 @@ def load_package(name, path):
extensions = (machinery.SOURCE_SUFFIXES[:] +
machinery.BYTECODE_SUFFIXES[:])
for extension in extensions:
- path = os.path.join(path, '__init__'+extension)
- if os.path.exists(path):
+ init_path = os.path.join(path, '__init__' + extension)
+ if os.path.exists(init_path):
+ path = init_path
break
else:
raise ValueError('{!r} is not a package'.format(path))