From c71f6e137e43da4c62a02f65c20b1a3181ed9c69 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Mon, 6 Nov 2023 13:27:26 +0200 Subject: [PATCH] Stop using deprecated `doc` attribute. Replace it with `doc_node` --- kiwi_lint/docstring.py | 4 ++-- kiwi_lint/similar_string.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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"] = (