提交 cbdd3bc5 编写于 作者: Y Yang Zhang 提交者: qingqing01

Safeguard docstring parsing (#40)

so that it does not choke on non conforming docstrings
上级 23214086
...@@ -195,7 +195,11 @@ def extract_schema(cls): ...@@ -195,7 +195,11 @@ def extract_schema(cls):
docs = cls.__doc__ docs = cls.__doc__
if docs is None and getattr(cls, '__category__', None) == 'op': if docs is None and getattr(cls, '__category__', None) == 'op':
docs = cls.__call__.__doc__ docs = cls.__call__.__doc__
try:
docstring = doc_parse(docs) docstring = doc_parse(docs)
except Exception:
docstring = None
if docstring is None: if docstring is None:
comments = {} comments = {}
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册