aboutsummaryrefslogtreecommitdiff
path: root/tools/cache.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-05 10:46:31 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-03-05 10:46:31 -0800
commitd62f6481b421d789d166c8237f85f08b2e7a0274 (patch)
tree5051c0de9425371fd9f04d463eb2c15eaf09218a /tools/cache.py
parent5d67258ce140b8431e2a5546a3c3f403a108445b (diff)
fix cache clear time saving
Diffstat (limited to 'tools/cache.py')
-rw-r--r--tools/cache.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/cache.py b/tools/cache.py
index eacf5a75..e7908fba 100644
--- a/tools/cache.py
+++ b/tools/cache.py
@@ -1,4 +1,4 @@
-import os.path, sys, shutil, hashlib, cPickle, zlib
+import os.path, sys, shutil, hashlib, cPickle, zlib, time
import tempfiles
@@ -19,9 +19,9 @@ class Cache:
def erase(self):
tempfiles.try_delete(self.dirname)
try:
- open(Cache.dirname + '__last_clear', 'w').write('last clear: ' + time.asctime() + '\n')
- except:
- print >> sys.stderr, 'failed to save last clear time'
+ open(self.dirname + '__last_clear', 'w').write('last clear: ' + time.asctime() + '\n')
+ except Exception, e:
+ print >> sys.stderr, 'failed to save last clear time: ', e
def get_path(self, shortname):
return os.path.join(self.dirname, shortname)