1
0
forked from VimPlug/jedi

Start using the parse function for caching as well.

This commit is contained in:
Dave Halter
2017-03-24 01:52:55 +01:00
parent fb4cff8ef9
commit ac0d0869c9
3 changed files with 33 additions and 33 deletions

View File

@@ -119,7 +119,6 @@ class ParserPickling(object):
greater than the original pickling time. In which case the pickled
parser is not up to date.
"""
path = self._clean_path(path)
try:
pickle_changed_time = self._index[path]
except KeyError:
@@ -144,7 +143,6 @@ class ParserPickling(object):
return parser_cache_item.parser
def save_parser(self, grammar, path, parser_cache_item):
path = self._clean_path(path)
self.__index = None
try:
files = self._index
@@ -191,9 +189,6 @@ class ParserPickling(object):
shutil.rmtree(self._cache_directory())
self.__index = {}
def _clean_path(self, path):
return os.path.expanduser(path)
def _get_hashed_path(self, grammar, path):
file_hash = hashlib.sha256(path.encode("utf-8")).hexdigest()
return self._get_path('%s-%s.pkl' % (grammar.sha256, file_hash))