We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53ad7ac commit 4d40816Copy full SHA for 4d40816
code.py
@@ -820,6 +820,16 @@ def download_application(full_name: str = None) -> bool:
820
if info.filename.split("/")[-1] == module_filename:
821
dirpath = info.filename[:-len(module_filename)].strip("/")
822
break
823
+
824
+ if dirpath is None:
825
+ # try finding top-level directory with .py files
826
+ min_parts = -1
827
+ for info in zf.infolist():
828
+ if info.filename.endswith(".py"):
829
+ parts = info.filename.split("/")[:-1]
830
+ if min_parts < 0 or min_parts > len(parts):
831
+ min_parts = len(parts)
832
+ dirpath = "/".join(parts).strip("/")
833
834
# make sure we found module
835
if dirpath is None:
0 commit comments