Skip to content

Commit

Permalink
g.extension: ignore cruft __pycache__ files (#1496)
Browse files Browse the repository at this point in the history
winGRASS related fix in `g.extension` to skip if precompiled zip-files contains an (undesired) `__pycache__` subdirectory.

(hopefully) fixes #1477
  • Loading branch information
neteler committed Apr 21, 2021
1 parent a51da56 commit 4c41265
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/g.extension/g.extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,8 @@ def extract_zip(name, directory, tmpdir):
extract_dir = os.path.join(tmpdir, "extract_dir")
os.mkdir(extract_dir)
for subfile in file_list:
# this should be safe in Python 2.7.4
if "__pycache__" in subfile:
continue
zip_file.extract(subfile, extract_dir)
files = os.listdir(extract_dir)
move_extracted_files(extract_dir=extract_dir, target_dir=directory, files=files)
Expand Down

0 comments on commit 4c41265

Please sign in to comment.