Skip to content

Commit df9ade9

Browse files
authored
AC: Update unsupported_special_methods (GH-24956)
1 parent 7278959 commit df9ade9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tools/clinic/clinic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,6 @@ def __repr__(self):
21592159
__mod__
21602160
__mul__
21612161
__neg__
2162-
__new__
21632162
__next__
21642163
__or__
21652164
__pos__
@@ -4227,6 +4226,9 @@ def state_modulename_name(self, line):
42274226
module, cls = self.clinic._module_and_class(fields)
42284227

42294228
fields = full_name.split('.')
4229+
if fields[-1] in unsupported_special_methods:
4230+
fail(f"{fields[-1]} is a special method and cannot be converted to Argument Clinic! (Yet.)")
4231+
42304232
if fields[-1] == '__new__':
42314233
if (self.kind != CLASS_METHOD) or (not cls):
42324234
fail("__new__ must be a class method!")
@@ -4237,8 +4239,6 @@ def state_modulename_name(self, line):
42374239
self.kind = METHOD_INIT
42384240
if not return_converter:
42394241
return_converter = init_return_converter()
4240-
elif fields[-1] in unsupported_special_methods:
4241-
fail(fields[-1] + " is a special method and cannot be converted to Argument Clinic! (Yet.)")
42424242

42434243
if not return_converter:
42444244
return_converter = CReturnConverter()

0 commit comments

Comments
 (0)