Преглед изворни кода

Merge pull request #709 from rec/master

Guard Lark.__doc__ assignment for tools.standalone
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.0
Erez Shinan пре 4 година
committed by GitHub
родитељ
комит
9af9a71029
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 измењених фајлова са 3 додато и 2 уклоњено
  1. +2
    -1
      lark/lark.py
  2. +1
    -1
      tests/test_tools.py

+ 2
- 1
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'



+ 1
- 1
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



Loading…
Откажи
Сачувај