8000 gh-59110: Fix a debug output for implicit directories (GH-121375) · python/cpython@1407530 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1407530

Browse files
serhiy-storchakapull[bot]
authored andcommitted
gh-59110: Fix a debug output for implicit directories (GH-121375)
1 parent 4766455 commit 1407530

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/zipimport.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ def _read_directory(archive):
558558
_bootstrap._verbose_message('zipimport: found {} names in {!r}', count, archive)
559559

560560
# Add implicit directories.
561+
count = 0
561562
for name in list(files):
562563
while True:
563564
i = name.rstrip(path_sep).rfind(path_sep)
@@ -568,8 +569,9 @@ def _read_directory(archive):
568569
break
569570
files[name] = None
570571
count += 1
571-
_bootstrap._verbose_message('zipimport: added {} implicit directories in {!r}',
572-
count, archive)
572+
if count:
573+
_bootstrap._verbose_message('zipimport: added {} implicit directories in {!r}',
574+
count, archive)
573575
return files
574576

575577
# During bootstrap, we may need to load the encodings

0 commit comments

Comments
 (0)
0