Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Lib/imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Ankur Ankan
Heidi Annexstad
Ramchandra Apte
Éric Araujo
Alexandru Ardelean
Alicia Arlen
Jeffrey Armstrong
Jason Asbahr
Expand Down
4 changes: 4 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ Library
- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was
called.

- bpo-30645: Fix path calculation in `imp.load_package()`, fixing it for
cases when a package is only shipped with bytecodes. Patch by
Alexandru Ardelean.

- bpo-11822: The dis.dis() function now is able to disassemble nested
code objects.

Expand Down