aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Tools
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2025-04-26 17:14:18 +0300
committerGitHub <noreply@github.com>2025-04-26 17:14:18 +0300
commit632524a5cbdd3e999992d0e9e68fe8b464ed16ec (patch)
treea06b248e5deeb502537885d67b6b1b55bde549f0 /Tools
parente714ead7a2895799b7f2cbded086378d92625a3a (diff)
downloadcpython-632524a5cbdd3e999992d0e9e68fe8b464ed16ec.tar.gz
cpython-632524a5cbdd3e999992d0e9e68fe8b464ed16ec.zip
gh-132987: Support __index__() for "k" and "K" formats in PyArg_Parse (GH-132988)
Diffstat (limited to 'Tools')
-rw-r--r--Tools/clinic/libclinic/converters.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/clinic/libclinic/converters.py b/Tools/clinic/libclinic/converters.py
index b176ee4ecd4..b0557ae54c1 100644
--- a/Tools/clinic/libclinic/converters.py
+++ b/Tools/clinic/libclinic/converters.py
@@ -386,7 +386,7 @@ class unsigned_long_converter(CConverter):
def parse_arg(self, argname: str, displayname: str, *, limited_capi: bool) -> str | None:
if self.format_unit == 'k':
return self.format_code("""
- if (!PyLong_Check({argname})) {{{{
+ if (!PyIndex_Check({argname})) {{{{
{bad_argument}
goto exit;
}}}}
@@ -444,7 +444,7 @@ class unsigned_long_long_converter(CConverter):
def parse_arg(self, argname: str, displayname: str, *, limited_capi: bool) -> str | None:
if self.format_unit == 'K':
return self.format_code("""
- if (!PyLong_Check({argname})) {{{{
+ if (!PyIndex_Check({argname})) {{{{
{bad_argument}
goto exit;
}}}}