Fixed a bug where providing a cache_path did not really affect anything.

This commit is contained in:
Dave Halter
2017-05-19 16:28:07 -04:00
parent 2d46d1e307
commit 88f8e172d5
2 changed files with 9 additions and 10 deletions

View File

@@ -152,8 +152,9 @@ def clear_cache(cache_path=None):
def _get_hashed_path(grammar, path, cache_path=None):
directory = _get_cache_directory_path(cache_path=cache_path)
file_hash = hashlib.sha256(path.encode("utf-8")).hexdigest()
directory = _get_cache_directory_path()
return os.path.join(directory, '%s-%s.pkl' % (grammar.sha256, file_hash))