catch ValueError when the cache json.load method fails, fixes #245

This commit is contained in:
David Halter
2013-07-19 10:54:49 +02:00
parent 4e34fb9494
commit ed99e380d7

View File

@@ -282,7 +282,7 @@ class _ModulePickling(object):
try: try:
with open(self._get_path('index.json')) as f: with open(self._get_path('index.json')) as f:
data = json.load(f) data = json.load(f)
except IOError: except (IOError, ValueError):
self.__index = {} self.__index = {}
else: else:
# 0 means version is not defined (= always delete cache): # 0 means version is not defined (= always delete cache):