]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41971: Fix test failure in test.test_tools.test_c_analyzer when mutating global...
authorPablo Galindo <Pablogsal@gmail.com>
Sun, 11 Oct 2020 20:34:51 +0000 (21:34 +0100)
committerGitHub <noreply@github.com>
Sun, 11 Oct 2020 20:34:51 +0000 (21:34 +0100)
Tools/c-analyzer/c_analyzer/common/files.py

index f630afe62592424f43d899768e578ecdb233ebb3..a8a044757d00b2bf86693e922a9a6a51cfde0394 100644 (file)
@@ -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: