Skip to content

Commit

Permalink
gh-59110: Fix a debug output for implicit directories (GH-121375)
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka authored and pull[bot] committed Jul 11, 2024
1 parent 4766455 commit 1407530
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/zipimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ def _read_directory(archive):
_bootstrap._verbose_message('zipimport: found {} names in {!r}', count, archive)

# Add implicit directories.
count = 0
for name in list(files):
while True:
i = name.rstrip(path_sep).rfind(path_sep)
Expand All @@ -568,8 +569,9 @@ def _read_directory(archive):
break
files[name] = None
count += 1
_bootstrap._verbose_message('zipimport: added {} implicit directories in {!r}',
count, archive)
if count:
_bootstrap._verbose_message('zipimport: added {} implicit directories in {!r}',
count, archive)
return files

# During bootstrap, we may need to load the encodings
Expand Down

0 comments on commit 1407530

Please sign in to comment.