Commit 133c83ed authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by Romain Bignon
Browse files

Tools to remove stale pyc files

parent 6dd82353
#!/usr/bin/env python
import os
import sys
root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
verbose = '-v' in sys.argv
for dirpath, dirnames, filenames in os.walk(root):
for filename in filenames:
if filename.endswith('.pyc') or filename.endswith('pyo'):
if not os.path.exists(os.path.join(dirpath, filename[:-1])):
os.unlink(os.path.join(dirpath, filename))
if verbose:
print os.path.join(dirpath, filename)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment