MCPcopy Index your code
hub / github.com/python/cpython / walk_tree

Function walk_tree

Tools/c-analyzer/c_common/fsutil.py:219–234  ·  view source on GitHub ↗

Yield each file in the tree under the given directory name. If "suffix" is provided then only files with that suffix will be included.

(root, *,
              suffix=None,
              walk=_walk_tree,
              )

Source from the content-addressed store, hash-verified

217
218
219def walk_tree(root, *,
220 suffix=None,
221 walk=_walk_tree,
222 ):
223 """Yield each file in the tree under the given directory name.
224
225 If "suffix" is provided then only files with that suffix will
226 be included.
227 """
228 if suffix and not isinstance(suffix, str):
229 raise ValueError('suffix must be a string')
230
231 for filename in walk(root):
232 if suffix and not filename.endswith(suffix):
233 continue
234 yield filename
235
236
237def glob_tree(root, *,

Callers

nothing calls this directly

Calls 2

walkFunction · 0.50
endswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…