aboutsummaryrefslogtreecommitdiff
path: root/tools/cache.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-15 18:21:34 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-15 18:21:34 -0700
commitb22f6fbbbebb5df55ceb8fdc9f7c4d111c902c5e (patch)
treec568136b2cf95d897d128b362720602a3b401244 /tools/cache.py
parent8c9a37a40a164dba330390af2eabf5ad05625001 (diff)
parent27d1a249622d33ab8aff2814d13569507336873b (diff)
Merge branch 'incoming'
Diffstat (limited to 'tools/cache.py')
-rw-r--r--tools/cache.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/cache.py b/tools/cache.py
index e7908fba..13a53fe9 100644
--- a/tools/cache.py
+++ b/tools/cache.py
@@ -73,7 +73,8 @@ class JCache:
try:
data = cPickle.loads(zlib.decompress(open(cachename).read()))
except Exception, e:
- if DEBUG_CACHE: print >> sys.stderr, 'jcache decompress/unpickle error:', e
+ if self.debug: print >> sys.stderr, 'jcache decompress/unpickle error:', e
+ return
if len(data) != 2:
if self.debug: print >> sys.stderr, 'jcache error in get'
return
@@ -96,7 +97,7 @@ class JCache:
f.write(zlib.compress(cPickle.dumps([keys, value])))
f.close()
except Exception, e:
- if DEBUG_CACHE: print >> sys.stderr, 'jcache compress/pickle error:', e
+ if self.debug: print >> sys.stderr, 'jcache compress/pickle error:', e
return
# for i in range(len(keys)):
# open(cachename + '.key' + str(i), 'w').write(keys[i])