https://github.com/python/cpython/commit/cecd6012b0ed5dca3916ae341e705ae44172991d
commit: cecd6012b0ed5dca3916ae341e705ae44172991d
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-07-05T11:44:07+03:00
summary:

gh-59110: Fix a debug output for implicit directories (GH-121375)

files:
M Lib/zipimport.py

diff --git a/Lib/zipimport.py b/Lib/zipimport.py
index a79862f1de7564..68f031f89c9996 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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to