Skip to content

Commit 27b0daa

Browse files
committed
fix: Stop using deprecated s AST node attribute
1 parent 064a684 commit 27b0daa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/pytkdocs/parsers/attributes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_pairs(nodes: list) -> Iterator[tuple]: # noqa: D103
6767
def get_module_or_class_attributes(nodes: list) -> dict: # noqa: D103
6868
result = {}
6969
for assignment, string_node in get_pairs(nodes):
70-
string = inspect.cleandoc(string_node.s) if string_node else None
70+
string = inspect.cleandoc(string_node.value) if string_node else None
7171
if isinstance(assignment, ast.Assign):
7272
names = []
7373
for target in assignment.targets:
@@ -148,7 +148,7 @@ def get_instance_attributes(func: Callable) -> dict: # noqa: D103
148148
if not names or (string is None and annotation is None):
149149
continue
150150

151-
docstring = inspect.cleandoc(string.s) if string else None
151+
docstring = inspect.cleandoc(string.value) if string else None
152152
for name in names:
153153
result[name] = {"annotation": annotation, "docstring": docstring}
154154

0 commit comments

Comments
 (0)