summaryrefslogtreecommitdiffstats
path: root/Tools/clinic
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na@python.org>2021-03-25 00:19:23 (GMT)
committerGitHub <noreply@github.com>2021-03-25 00:19:23 (GMT)
commitdf9ade9beb86935963f8ae47d9377578399ab6d2 (patch)
tree7ea98f3f06790bc1805666851570420fd24bdd45 /Tools/clinic
parent72789592a3491bab49f144bb292679b1484885d9 (diff)
downloadcpython-df9ade9beb86935963f8ae47d9377578399ab6d2.zip
cpython-df9ade9beb86935963f8ae47d9377578399ab6d2.tar.gz
cpython-df9ade9beb86935963f8ae47d9377578399ab6d2.tar.bz2
AC: Update unsupported_special_methods (GH-24956)
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-xTools/clinic/clinic.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index d4d7795..9597426 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -2159,7 +2159,6 @@ __matmul__
__mod__
__mul__
__neg__
-__new__
__next__
__or__
__pos__
@@ -4227,6 +4226,9 @@ class DSLParser:
module, cls = self.clinic._module_and_class(fields)
fields = full_name.split('.')
+ if fields[-1] in unsupported_special_methods:
+ fail(f"{fields[-1]} is a special method and cannot be converted to Argument Clinic! (Yet.)")
+
if fields[-1] == '__new__':
if (self.kind != CLASS_METHOD) or (not cls):
fail("__new__ must be a class method!")
@@ -4237,8 +4239,6 @@ class DSLParser:
self.kind = METHOD_INIT
if not return_converter:
return_converter = init_return_converter()
- elif fields[-1] in unsupported_special_methods:
- fail(fields[-1] + " is a special method and cannot be converted to Argument Clinic! (Yet.)")
if not return_converter:
return_converter = CReturnConverter()