Merge pull request #789 from blueyed/parser.utils.clear_cache-clear-self.__index

parser.utils.clear_cache: clear self.__index
This commit is contained in:
Dave Halter
2016-10-23 18:03:43 +02:00
committed by GitHub

View File

@@ -160,7 +160,6 @@ class ParserPickling(object):
# 0 means version is not defined (= always delete cache):
if data.get('version', 0) != self.version:
self.clear_cache()
self.__index = {}
else:
self.__index = data['index']
return self.__index
@@ -180,6 +179,7 @@ class ParserPickling(object):
def clear_cache(self):
shutil.rmtree(self._cache_directory())
self.__index = {}
def _get_hashed_path(self, path):
return self._get_path('%s.pkl' % hashlib.md5(path.encode("utf-8")).hexdigest())