Skip to content

Commit cec31d6

Browse files
hauntsaninjajhance
authored andcommitted
Fix stubtest crash in explicit init subclass (#15399)
1 parent 7886503 commit cec31d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/stubtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ def _verify_arg_default_value(
668668

669669

670670
def maybe_strip_cls(name: str, args: list[nodes.Argument]) -> list[nodes.Argument]:
671-
if name in ("__init_subclass__", "__class_getitem__"):
671+
if args and name in ("__init_subclass__", "__class_getitem__"):
672672
# These are implicitly classmethods. If the stub chooses not to have @classmethod, we
673673
# should remove the cls argument
674674
if args[0].variable.name == "cls":

0 commit comments

Comments
 (0)