diff --git a/lark/lark.py b/lark/lark.py index e749138..4acc9b8 100644 --- a/lark/lark.py +++ b/lark/lark.py @@ -310,7 +310,8 @@ class Lark(Serialize): with FS.open(cache_fn, 'wb') as f: self.save(f) - __doc__ += "\n\n" + LarkOptions.OPTIONS_DOC + if __doc__: + __doc__ += "\n\n" + LarkOptions.OPTIONS_DOC __serialize_fields__ = 'parser', 'rules', 'options' diff --git a/tests/test_tools.py b/tests/test_tools.py index f7e0c47..ce995d8 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -25,7 +25,7 @@ class TestStandalone(TestCase): standalone.main(StringIO(grammar), 'start', print=pr) code = code_buf.getvalue() - context = {} + context = {'__doc__': None} exec(code, context) return context