diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-07-05 08:44:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-05 08:44:07 (GMT) |
commit | cecd6012b0ed5dca3916ae341e705ae44172991d (patch) | |
tree | c3f9781762c3fae48025a884f6419cf58791f90a /Lib/zipimport.py | |
parent | db39bc42f90c151b298f97b780e62703adbf1221 (diff) | |
download | cpython-cecd6012b0ed5dca3916ae341e705ae44172991d.zip cpython-cecd6012b0ed5dca3916ae341e705ae44172991d.tar.gz cpython-cecd6012b0ed5dca3916ae341e705ae44172991d.tar.bz2 |
gh-59110: Fix a debug output for implicit directories (GH-121375)
Diffstat (limited to 'Lib/zipimport.py')
-rw-r--r-- | Lib/zipimport.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/zipimport.py b/Lib/zipimport.py index a79862f..68f031f 100644 --- a/Lib/zipimport.py +++ b/Lib/zipimport.py @@ -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) @@ -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 |