gh-108494: Argument Clinic: inline parsing code for positional-only parameters in the limited C API (GH-108622)

This commit is contained in:
Serhiy Storchaka 2023-09-03 17:28:14 +03:00 committed by GitHub
parent 55846099b1
commit 1796c191b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 555 additions and 307 deletions

View file

@ -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"