Skip to content

Commit 7623025

Browse files
committed
types(aafig) Fix typing issues in mypy 1.16.0
Run uv run mypy . docs/_ext/aafig.py:71: error: Unused "type: ignore" comment [unused-ignore] docs/_ext/aafig.py:85: error: Item "None" of "Optional[dict[str, Callable[[str], Any]]]" has no attribute "copy" [union-attr] docs/_ext/aafig.py:106: error: "Node" has no attribute "aafig" [attr-defined] Found 3 errors in 1 file (checked 99 source files)
1 parent a339934 commit 7623025

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/_ext/aafig.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class AafigError(SphinxError):
6868
category = "aafig error"
6969

7070

71-
class AafigDirective(images.Image): # type:ignore
71+
class AafigDirective(images.Image):
7272
"""Directive to insert an ASCII art figure to be rendered by aafigure."""
7373

7474
has_content = True
@@ -82,7 +82,7 @@ class AafigDirective(images.Image): # type:ignore
8282
"textual": flag,
8383
"proportional": flag,
8484
}
85-
option_spec = images.Image.option_spec.copy()
85+
option_spec = images.Image.option_spec.copy() if images.Image.option_spec is not None else {}
8686
option_spec.update(own_option_spec)
8787

8888
def run(self) -> list[nodes.Node]:
@@ -103,7 +103,7 @@ def run(self) -> list[nodes.Node]:
103103
if isinstance(image_node, nodes.system_message):
104104
return [image_node]
105105
text = "\n".join(self.content)
106-
image_node.aafig = {"options": aafig_options, "text": text}
106+
image_node.aafig = {"options": aafig_options, "text": text} # type: ignore[attr-defined]
107107
return [image_node]
108108

109109

0 commit comments

Comments
 (0)