summaryrefslogtreecommitdiff
path: root/pylint/extensions/_check_docs_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/extensions/_check_docs_utils.py')
-rw-r--r--pylint/extensions/_check_docs_utils.py13
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]: