mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-108494: Argument Clinic: inline parsing code for positional-only parameters in the limited C API (GH-108622)
This commit is contained in:
parent
55846099b1
commit
1796c191b4
13 changed files with 555 additions and 307 deletions
|
@ -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"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue