From 3a0cd6d37783b4be1597d9c9ab1158c1b99924aa Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 21 May 2017 17:35:32 -0400 Subject: [PATCH] Make sha256 private to avoid confusion for the end user. --- parso/cache.py | 2 +- parso/grammar.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parso/cache.py b/parso/cache.py index bc9cef0..cc9e4ee 100644 --- a/parso/cache.py +++ b/parso/cache.py @@ -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): diff --git a/parso/grammar.py b/parso/grammar.py index e61660c..927696c 100644 --- a/parso/grammar.py +++ b/parso/grammar.py @@ -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()