From 009ba1d605d1a8dcb091dfbba21041a02218641a Mon Sep 17 00:00:00 2001 From: Ashley Whetter Date: Wed, 16 May 2018 14:06:43 -0700 Subject: Fixed up a couple of docstrings --- pylint/extensions/_check_docs_utils.py | 4 ++-- pylint/extensions/docparams.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pylint/extensions/_check_docs_utils.py b/pylint/extensions/_check_docs_utils.py index e65820a16..2a0d9c3b4 100644 --- a/pylint/extensions/_check_docs_utils.py +++ b/pylint/extensions/_check_docs_utils.py @@ -106,7 +106,7 @@ def possible_exc_types(node): :type node: astroid.node_classes.NodeNG :returns: A list of exception types possibly raised by :param:`node`. - :rtype: list(str) + :rtype: set(str) """ excs = [] if isinstance(node.exc, astroid.Name): @@ -142,7 +142,7 @@ def possible_exc_types(node): try: return set(exc for exc in excs if not utils.node_ignores_exception(node, exc)) except astroid.InferenceError: - return () + return set() def docstringify(docstring): diff --git a/pylint/extensions/docparams.py b/pylint/extensions/docparams.py index e14618025..b5df38882 100644 --- a/pylint/extensions/docparams.py +++ b/pylint/extensions/docparams.py @@ -213,7 +213,7 @@ class DocstringParameterChecker(BaseChecker): return found_excs = doc.exceptions() - missing_excs = list(expected_excs - found_excs) + missing_excs = expected_excs - found_excs self._add_raise_message(missing_excs, func_node) def visit_return(self, node): @@ -414,7 +414,7 @@ class DocstringParameterChecker(BaseChecker): Adds a message on :param:`node` for the missing exception type. :param missing_excs: A list of missing exception types. - :type missing_excs: list + :type missing_excs: set(str) :param node: The node show the message on. :type node: astroid.node_classes.NodeNG @@ -422,7 +422,7 @@ class DocstringParameterChecker(BaseChecker): if node.is_abstract(): try: missing_excs.remove('NotImplementedError') - except ValueError: + except KeyError: pass if not missing_excs: -- cgit v1.2.1