diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2016-07-18 14:32:08 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-07-18 14:42:41 +0300 |
commit | bd95bdf4fc265b15f35bafc19037cf54e2948628 (patch) | |
tree | 34aefb68c4a0ff439874b3df63c36f6203b191ff /pylint/extensions/_check_docs_utils.py | |
parent | 56de57047b14e312cf55403b62a8284cf02427e2 (diff) | |
download | pylint-git-bd95bdf4fc265b15f35bafc19037cf54e2948628.tar.gz |
Do not crash when calling unpack_infer. Close #998
Diffstat (limited to 'pylint/extensions/_check_docs_utils.py')
-rw-r--r-- | pylint/extensions/_check_docs_utils.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pylint/extensions/_check_docs_utils.py b/pylint/extensions/_check_docs_utils.py index 39d7550b7..f1884d758 100644 --- a/pylint/extensions/_check_docs_utils.py +++ b/pylint/extensions/_check_docs_utils.py @@ -68,11 +68,14 @@ def possible_exc_types(node): handler = handler.parent if handler and handler.type: - excs = astroid.unpack_infer(handler.type) - excs = (exc.name for exc in excs if exc is not astroid.YES) - - excs = set(exc for exc in excs if not node_ignores_exception(node, exc)) - return excs + inferred_excs = astroid.unpack_infer(handler.type) + excs = (exc.name for exc in inferred_excs + if exc is not astroid.YES) + + try: + return set(exc for exc in excs if not node_ignores_exception(node, exc)) + except astroid.InferenceError: + return () def docstringify(docstring): for docstring_type in [SphinxDocstring, GoogleDocstring, NumpyDocstring]: |