Skip to content
Merged
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
10 changes: 10 additions & 0 deletions code.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,16 @@ def download_application(full_name: str = None) -> bool:
if info.filename.split("/")[-1] == module_filename:
dirpath = info.filename[:-len(module_filename)].strip("/")
break

if dirpath is None:
# try finding top-level directory with .py files
min_parts = -1
for info in zf.infolist():
if info.filename.endswith(".py"):
parts = info.filename.split("/")[:-1]
if min_parts < 0 or min_parts > len(parts):
min_parts = len(parts)
dirpath = "/".join(parts).strip("/")

# make sure we found module
if dirpath is None:
Expand Down