Skip to content

Commit

Permalink
Fix stubtest crash in explicit init subclass (#15399)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored and jhance committed Jun 12, 2023
1 parent 7886503 commit cec31d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def _verify_arg_default_value(


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

0 comments on commit cec31d6

Please sign in to comment.