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

Function cleanout

Lib/test/test_pkg.py:12–20  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

10# Helpers to create and destroy hierarchies.
11
12def cleanout(root):
13 names = os.listdir(root)
14 for name in names:
15 fullname = os.path.join(root, name)
16 if os.path.isdir(fullname) and not os.path.islink(fullname):
17 cleanout(fullname)
18 else:
19 os.remove(fullname)
20 os.rmdir(root)
21
22def fixdir(lst):
23 if "__builtins__" in lst:

Callers 1

tearDownMethod · 0.85

Calls 6

listdirMethod · 0.80
islinkMethod · 0.80
rmdirMethod · 0.80
joinMethod · 0.45
isdirMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…