self.version, self.data = pickle.load(cachefile)
if(self.version != CACHE_VERSION):
logging.warning("Cache file has version %s and the script version is %s.",
- self.version, self.data)
+ self.version, CACHE_VERSION)
raise IOError
logging.info("Cache version %s", self.version)
logging.debug("%s users found.", len(self.data))
self.version = CACHE_VERSION
self.data = {}
with open(CACHE_FILENAME, 'wb') as cachefile:
- pickle.dump((0, self.data), cachefile)
+ pickle.dump((self.version, self.data), cachefile)
def __del__(self):
# create temporary file first