Skip to content

Commit c712079

Browse files
Do not use deprecated add_method in attrs plugin (#16037)
CC @ikonst --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent bd212bc commit c712079

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/plugins/attrs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
_get_bool_argument,
5252
_get_decorator_bool_argument,
5353
add_attribute_to_class,
54-
add_method,
54+
add_method_to_class,
5555
deserialize_and_fixup_type,
5656
)
5757
from mypy.server.trigger import make_wildcard_trigger
@@ -952,7 +952,9 @@ def add_method(
952952
tvd: If the method is generic these should be the type variables.
953953
"""
954954
self_type = self_type if self_type is not None else self.self_type
955-
add_method(self.ctx, method_name, args, ret_type, self_type, tvd)
955+
add_method_to_class(
956+
self.ctx.api, self.ctx.cls, method_name, args, ret_type, self_type, tvd
957+
)
956958

957959

958960
def _get_attrs_init_type(typ: Instance) -> CallableType | None:

0 commit comments

Comments
 (0)