Skip to content

Commit

Permalink
Fixed dataclasses plugin after merging master.
Browse files Browse the repository at this point in the history
Caused by python#11332
  • Loading branch information
freundTech committed Oct 20, 2021
1 parent 13b675b commit e437323
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mypy/plugins/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ def transform(self) -> None:
('__match_args__' not in info.names or
info.names['__match_args__'].plugin_generated) and
attributes):
str_type = ctx.api.named_type("__builtins__.str")
str_type = ctx.api.named_type("builtins.str")
literals: List[Type] = [LiteralType(attr.name, str_type)
for attr in attributes if attr.is_in_init]
match_args_type = TupleType(literals, ctx.api.named_type("__builtins__.tuple"))
match_args_type = TupleType(literals, ctx.api.named_type("builtins.tuple"))
add_attribute_to_class(ctx.api, ctx.cls, "__match_args__", match_args_type, final=True)

self._add_dataclass_fields_magic_attribute()
Expand Down

0 comments on commit e437323

Please sign in to comment.