summaryrefslogtreecommitdiffstats
path: root/Modules/resource.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-09-03 14:28:14 (GMT)
committerGitHub <noreply@github.com>2023-09-03 14:28:14 (GMT)
commit1796c191b43ed0787d83c07be7de8118fb10e8b0 (patch)
treea49fc1fa54d8d6a375516f6e6d1cd6648caf5a78 /Modules/resource.c
parent55846099b155833320bc6d64b03d902028bad439 (diff)
downloadcpython-1796c191b43ed0787d83c07be7de8118fb10e8b0.zip
cpython-1796c191b43ed0787d83c07be7de8118fb10e8b0.tar.gz
cpython-1796c191b43ed0787d83c07be7de8118fb10e8b0.tar.bz2
gh-108494: Argument Clinic: inline parsing code for positional-only parameters in the limited C API (GH-108622)
Diffstat (limited to 'Modules/resource.c')
-rw-r--r--Modules/resource.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/resource.c b/Modules/resource.c
index 9e302a3..d65509e 100644
--- a/Modules/resource.c
+++ b/Modules/resource.c
@@ -23,15 +23,16 @@ class pid_t_converter(CConverter):
type = 'pid_t'
format_unit = '" _Py_PARSE_PID "'
- def parse_arg(self, argname, displayname):
- return """
+ def parse_arg(self, argname, displayname, *, limited_capi):
+ return self.format_code("""
{paramname} = PyLong_AsPid({argname});
if ({paramname} == -1 && PyErr_Occurred()) {{{{
goto exit;
}}}}
- """.format(argname=argname, paramname=self.parser_name)
+ """,
+ argname=argname)
[python start generated code]*/
-/*[python end generated code: output=da39a3ee5e6b4b0d input=5af1c116d56cbb5a]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=c94349aa1aad151d]*/
#include "clinic/resource.c.h"