Skip to content

Commit 4af6729

Browse files
bpo-41971: Fix test failure in test.test_tools.test_c_analyzer when mutating global state (GH-22652) (GH-22653)
(cherry picked from commit 47ecfd8) Co-authored-by: Pablo Galindo <[email protected]> Co-authored-by: Pablo Galindo <[email protected]>
1 parent f1c70cf commit 4af6729

File tree

1 file changed

+3
-1
lines changed
  • Tools/c-analyzer/c_analyzer/common

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def glob_tree(root, *,
6060

6161

6262
def iter_files(root, suffix=None, relparent=None, *,
63-
get_files=os.walk,
63+
get_files=None,
6464
_glob=glob_tree,
6565
_walk=walk_tree,
6666
):
@@ -75,6 +75,8 @@ def iter_files(root, suffix=None, relparent=None, *,
7575
if "relparent" is provided then it is used to resolve each
7676
filename as a relative path.
7777
"""
78+
if get_files is None:
79+
get_files = os.walk
7880
if not isinstance(root, str):
7981
roots = root
8082
for root in roots:

0 commit comments

Comments
 (0)