diff --git a/kiwi_lint/docstring.py b/kiwi_lint/docstring.py index 1f0738b390..3ed502a731 100644 --- a/kiwi_lint/docstring.py +++ b/kiwi_lint/docstring.py @@ -58,7 +58,7 @@ def visit_functiondef(self, node): @utils.only_required_for_messages("use-triple-double-quotes") def _check_docstring(self, node): - if node.doc in self._string_tokens: - token = self._string_tokens[node.doc] + if node.doc_node and node.doc_node.value in self._string_tokens: + token = self._string_tokens[node.doc_node.value] if not token.startswith('"""'): self.add_message("use-triple-double-quotes", node=node) diff --git a/kiwi_lint/similar_string.py b/kiwi_lint/similar_string.py index b0518b654a..ac37b0ee48 100644 --- a/kiwi_lint/similar_string.py +++ b/kiwi_lint/similar_string.py @@ -87,7 +87,7 @@ def check_similar_and_add_error_message( if similar_string: if isinstance(node, str): - error_message["node"] = astroid.Module(node, file=node, doc=None) + error_message["node"] = astroid.Module(node, file=node) else: error_message["node"] = node error_message["args"] = (