diff options
Diffstat (limited to 'tools/tempfiles.py')
-rw-r--r-- | tools/tempfiles.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/tempfiles.py b/tools/tempfiles.py new file mode 100644 index 00000000..1953691e --- /dev/null +++ b/tools/tempfiles.py @@ -0,0 +1,8 @@ +import os +import shutil + +def try_delete(filename): + try: + os.unlink(filename) + except: + shutil.rmtree(filename, ignore_errors=True) |