瀏覽代碼

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
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 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…
取消
儲存