Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stubtest crash in explicit init subclass #15399

Merged
merged 1 commit into from Jun 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypy/stubtest.py
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