flush_compiler_caches.py 346 B

123456789101112
  1. def flush():
  2. import os, re, os.path
  3. pattern = "^.*\.pickle$"
  4. mypath = "."
  5. for root, dirs, files in os.walk(mypath):
  6. for file in filter(lambda x: re.match(pattern, x), files):
  7. print("Remove: %s" % os.path.join(root, file))
  8. os.remove(os.path.join(root, file))
  9. if __name__ == "__main__":
  10. flush()