Skip to content

Commit

Permalink
do not add zip file entries for non-empty directories
Browse files Browse the repository at this point in the history
Co-authored-by: Lisandro Dalcin <dalcinl@gmail.com>
  • Loading branch information
mayeut and dalcinl authored Dec 14, 2024
1 parent a1633d3 commit fbdd62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/auditwheel/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def dir2zip(in_dir: str, zip_fname: str, date_time: datetime | None = None) -> N
compression = zipfile.ZIP_DEFLATED
with zipfile.ZipFile(zip_fname, "w", compression=compression) as z:
for root, dirs, files in walk(in_dir):
if root != in_dir:
if root != in_dir and not (dirs or files):
dname = root

Check warning on line 125 in src/auditwheel/tools.py

View check run for this annotation

Codecov / codecov/patch

src/auditwheel/tools.py#L125

Added line #L125 was not covered by tests
out_dname = os.path.relpath(dname, in_dir) + "/"
zinfo = zipfile.ZipInfo.from_file(dname, out_dname)
Expand Down

0 comments on commit fbdd62e

Please sign in to comment.