From 46bb1e1d6322e3dbf20915b415c7530ce3d81a46 Mon Sep 17 00:00:00 2001 From: Erez Sh Date: Sun, 14 Jun 2020 12:37:51 +0300 Subject: [PATCH] Cache now also depends on the Lark version --- lark/lark.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lark/lark.py b/lark/lark.py index 4497dd1..3855191 100644 --- a/lark/lark.py +++ b/lark/lark.py @@ -180,8 +180,9 @@ class Lark(Serialize): if self.options.cache is not True: raise ValueError("cache must be bool or str") unhashable = ('transformer', 'postlex', 'lexer_callbacks', 'edit_terminals') + from . import __version__ options_str = ''.join(k+str(v) for k, v in options.items() if k not in unhashable) - s = grammar + options_str + s = grammar + options_str + __version__ md5 = hashlib.md5(s.encode()).hexdigest() cache_fn = '.lark_cache_%s.tmp' % md5