aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-07 11:44:06 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-03-07 11:44:06 -0800
commit771a2b6a7d21fa6369fc6f21381ba16baae43005 (patch)
treef8bd526f067213cdd0400814904d6f761afad287
parentc5172f9b41103c195260b4de96cba6b119b924c2 (diff)
parenta094e001caf56feae979d259e746bf1c0f4c0d46 (diff)
Merge pull request #933 from vvuk/cache-fix
Fix debug prints in 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])