From cbdd3bc5cb4d7629e21afede1df21f83c7280ee3 Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Wed, 11 Dec 2019 10:38:23 +0800 Subject: [PATCH] Safeguard docstring parsing (#40) so that it does not choke on non conforming docstrings --- ppdet/core/config/schema.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ppdet/core/config/schema.py b/ppdet/core/config/schema.py index 4465c7306..6b55cd50f 100644 --- a/ppdet/core/config/schema.py +++ b/ppdet/core/config/schema.py @@ -195,7 +195,11 @@ def extract_schema(cls): docs = cls.__doc__ if docs is None and getattr(cls, '__category__', None) == 'op': docs = cls.__call__.__doc__ - docstring = doc_parse(docs) + try: + docstring = doc_parse(docs) + except Exception: + docstring = None + if docstring is None: comments = {} else: -- GitLab