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

Function deltree

PCbuild/rmpyc.py:4–16  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

2
3
4def deltree(root):
5 import os
6 from os.path import join
7
8 npyc = 0
9 for root, dirs, files in os.walk(root):
10 for name in files:
11 # to be thorough
12 if name.endswith(('.pyc', '.pyo')):
13 npyc += 1
14 os.remove(join(root, name))
15
16 return npyc
17
18npyc = deltree("../Lib")
19print(npyc, ".pyc deleted")

Callers 1

rmpyc.pyFile · 0.85

Calls 4

joinFunction · 0.90
walkMethod · 0.45
endswithMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…