[Python-checkins] bpo-41971: Fix test failure in test.test_tools.test_c_analyzer when mutating global state (GH-22652)

Pablo Galindo webhook-mailer at python.org
Sun Oct 11 16:35:00 EDT 2020


https://github.com/python/cpython/commit/47ecfd8030c391779dd9d3b4b07e6b01a8392481
commit: 47ecfd8030c391779dd9d3b4b07e6b01a8392481
branch: master
author: Pablo Galindo <Pablogsal at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-10-11T21:34:51+01:00
summary:

bpo-41971: Fix test failure in test.test_tools.test_c_analyzer when mutating global state (GH-22652)

files:
M Tools/c-analyzer/c_analyzer/common/files.py

diff --git a/Tools/c-analyzer/c_analyzer/common/files.py b/Tools/c-analyzer/c_analyzer/common/files.py
index f630afe625924..a8a044757d00b 100644
--- a/Tools/c-analyzer/c_analyzer/common/files.py
+++ b/Tools/c-analyzer/c_analyzer/common/files.py
@@ -60,7 +60,7 @@ def glob_tree(root, *,
 
 
 def iter_files(root, suffix=None, relparent=None, *,
-               get_files=os.walk,
+               get_files=None,
                _glob=glob_tree,
                _walk=walk_tree,
                ):
@@ -75,6 +75,8 @@ def iter_files(root, suffix=None, relparent=None, *,
     if "relparent" is provided then it is used to resolve each
     filename as a relative path.
     """
+    if get_files is None:
+        get_files = os.walk
     if not isinstance(root, str):
         roots = root
         for root in roots:



More information about the Python-checkins mailing list