summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorMiss Skeleton (bot) <31488909+miss-islington@users.noreply.github.com>2020-10-11 20:54:35 (GMT)
committerGitHub <noreply@github.com>2020-10-11 20:54:35 (GMT)
commit4af672921949b8a10340d5e29b456091060cedeb (patch)
tree21a79ac4ffb8dd09c85d29a1f1ed7ae327be53a8 /Tools
parentf1c70cf9e850b58a5b676e469dfc0c01e3f6778a (diff)
downloadcpython-4af672921949b8a10340d5e29b456091060cedeb.zip
cpython-4af672921949b8a10340d5e29b456091060cedeb.tar.gz
cpython-4af672921949b8a10340d5e29b456091060cedeb.tar.bz2
bpo-41971: Fix test failure in test.test_tools.test_c_analyzer when mutating global state (GH-22652) (GH-22653)
(cherry picked from commit 47ecfd8030c391779dd9d3b4b07e6b01a8392481) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Tools')
-rw-r--r--Tools/c-analyzer/c_analyzer/common/files.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Tools/c-analyzer/c_analyzer/common/files.py b/Tools/c-analyzer/c_analyzer/common/files.py
index f630afe..a8a0447 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: