MCPcopy Create free account
hub / github.com/CharlesPikachu/paperdl / removepycache

Function removepycache

scripts/clean_pkg_cache.py:16–27  ·  view source on GitHub ↗
(root: str | os.PathLike = ".")

Source from the content-addressed store, hash-verified

14
15'''removepycache'''
16def removepycache(root: str | os.PathLike = ".") -> int:
17 root_path, removed = Path(root).resolve(), 0
18 for p in root_path.rglob("__pycache__"):
19 if p.is_dir():
20 try:
21 shutil.rmtree(p)
22 removed += 1
23 print(f"Removed: {p}")
24 except Exception as e:
25 print(f"Failed: {p} ({e})")
26 print(f"\nDone. Removed {removed} __pycache__ directories under {root_path}")
27 return removed
28
29
30'''run'''

Callers 1

clean_pkg_cache.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected