mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-06 12:54:29 +08:00
Make sha256 private to avoid confusion for the end user.
This commit is contained in:
@@ -155,7 +155,7 @@ 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()
|
||||
return os.path.join(directory, '%s-%s.pkl' % (grammar.sha256, file_hash))
|
||||
return os.path.join(directory, '%s-%s.pkl' % (grammar._sha256, file_hash))
|
||||
|
||||
|
||||
def _get_cache_directory_path(cache_path=None):
|
||||
|
||||
@@ -9,7 +9,7 @@ class Grammar(object):
|
||||
self._parser = parser
|
||||
self._tokenizer = tokenizer
|
||||
self._diff_parser = diff_parser
|
||||
self.sha256 = hashlib.sha256(bnf_text.encode("utf-8")).hexdigest()
|
||||
self._sha256 = hashlib.sha256(bnf_text.encode("utf-8")).hexdigest()
|
||||
|
||||
def __repr__(self):
|
||||
labels = self._pgen_grammar.symbol2number.values()
|
||||
|
||||
Reference in New Issue
Block a user