aboutsummaryrefslogtreecommitdiff
path: root/tools/tempfiles.py
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-02-20 13:58:20 -0800
committerChad Austin <chad@imvu.com>2013-03-04 19:34:54 -0800
commit4bde971a1f51eaa9c6da2e54a295ff04183cbab5 (patch)
tree29c3627dc1b04ef387b5d2f4c5087f5f7b140b32 /tools/tempfiles.py
parentd84a4ec1a48534211afc89590bd04af4cfd27f13 (diff)
Isolate shutil.rmtree logic in tempfiles.try_delete, and integrate azakai's feedback
Diffstat (limited to 'tools/tempfiles.py')
-rw-r--r--tools/tempfiles.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/tempfiles.py b/tools/tempfiles.py
index 06c4d1dd..1721b2bb 100644
--- a/tools/tempfiles.py
+++ b/tools/tempfiles.py
@@ -6,7 +6,8 @@ def try_delete(filename):
try:
os.unlink(filename)
except:
- shutil.rmtree(filename, ignore_errors=True)
+ if os.path.exists(filename):
+ shutil.rmtree(filename, ignore_errors=True)
class TempFiles:
def __init__(self, tmp, save_debug_files=False):