Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-113317: Pass clinic to AC parse_arg() methods #114319

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Modules/_multiprocessing/multiprocessing.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class HANDLE_converter(CConverter):
type = "HANDLE"
format_unit = '"F_HANDLE"'

def parse_arg(self, argname, displayname, *, limited_capi):
def parse_arg(self, argname, displayname, *, limited_capi, clinic):
return self.format_code("""
{paramname} = PyLong_AsVoidPtr({argname});
if (!{paramname} && PyErr_Occurred()) {{{{
Expand All @@ -24,7 +24,7 @@ class HANDLE_converter(CConverter):
argname=argname)

[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=3cf0318efc6a8772]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=47f380fb213296a1]*/

/*[clinic input]
module _multiprocessing
Expand Down
4 changes: 2 additions & 2 deletions Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class pid_t_converter(CConverter):
type = 'pid_t'
format_unit = '" _Py_PARSE_PID "'

def parse_arg(self, argname, displayname, *, limited_capi):
def parse_arg(self, argname, displayname, *, limited_capi, clinic):
return self.format_code("""
{paramname} = PyLong_AsPid({argname});
if ({paramname} == -1 && PyErr_Occurred()) {{{{
Expand All @@ -96,7 +96,7 @@ class pid_t_converter(CConverter):
""",
argname=argname)
[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=c94349aa1aad151d]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=aa9c0e6301db8ef6]*/

#include "clinic/_posixsubprocess.c.h"

Expand Down
4 changes: 2 additions & 2 deletions Modules/_struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class cache_struct_converter(CConverter):
c_default = "NULL"
broken_limited_capi = True

def parse_arg(self, argname, displayname, *, limited_capi):
def parse_arg(self, argname, displayname, *, limited_capi, clinic):
assert not limited_capi
return self.format_code("""
if (!{converter}(module, {argname}, &{paramname})) {{{{
Expand All @@ -122,7 +122,7 @@ class cache_struct_converter(CConverter):
def cleanup(self):
return "Py_XDECREF(%s);\n" % self.name
[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=c33b27d6b06006c6]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=80f70ca6a3b875f7]*/

static int cache_struct_converter(PyObject *, PyObject *, PyStructObject **);

Expand Down
6 changes: 3 additions & 3 deletions Modules/overlapped.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
class pointer_converter(CConverter):
format_unit = '"F_POINTER"'

def parse_arg(self, argname, displayname, *, limited_capi):
def parse_arg(self, argname, displayname, *, limited_capi, clinic):
return self.format_code("""
{paramname} = PyLong_AsVoidPtr({argname});
if (!{paramname} && PyErr_Occurred()) {{{{
Expand All @@ -56,7 +56,7 @@ class HANDLE_converter(pointer_converter):
class ULONG_PTR_converter(pointer_converter):
type = 'ULONG_PTR'

def parse_arg(self, argname, displayname, *, limited_capi):
def parse_arg(self, argname, displayname, *, limited_capi, clinic):
return self.format_code("""
{paramname} = (uintptr_t)PyLong_AsVoidPtr({argname});
if (!{paramname} && PyErr_Occurred()) {{{{
Expand All @@ -71,7 +71,7 @@ class DWORD_converter(unsigned_long_converter):
class BOOL_converter(int_converter):
type = 'BOOL'
[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=436f4440630a304c]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=8a9cdb4812199916]*/

/*[clinic input]
module _overlapped
Expand Down
4 changes: 2 additions & 2 deletions Modules/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class pid_t_converter(CConverter):
type = 'pid_t'
format_unit = '" _Py_PARSE_PID "'

def parse_arg(self, argname, displayname, *, limited_capi):
def parse_arg(self, argname, displayname, *, limited_capi, clinic):
return self.format_code("""
{paramname} = PyLong_AsPid({argname});
if ({paramname} == -1 && PyErr_Occurred()) {{{{
Expand All @@ -39,7 +39,7 @@ class pid_t_converter(CConverter):
""",
argname=argname)
[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=c94349aa1aad151d]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=aa9c0e6301db8ef6]*/

#include "clinic/resource.c.h"

Expand Down
4 changes: 2 additions & 2 deletions PC/_testconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class HANDLE_converter(CConverter):
type = 'void *'
format_unit = '"_Py_PARSE_UINTPTR"'

def parse_arg(self, argname, displayname, *, limited_capi):
def parse_arg(self, argname, displayname, *, limited_capi, clinic):
return self.format_code("""
{paramname} = PyLong_AsVoidPtr({argname});
if (!{paramname} && PyErr_Occurred()) {{{{
Expand All @@ -49,7 +49,7 @@ class HANDLE_converter(CConverter):
""",
argname=argname)
[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=380aa5c91076742b]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=b12b8e675b3d0739]*/
/*[python end generated code:]*/

/*[clinic input]
Expand Down
4 changes: 2 additions & 2 deletions PC/msvcrtmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class HANDLE_converter(CConverter):
type = 'void *'
format_unit = '"_Py_PARSE_UINTPTR"'

def parse_arg(self, argname, displayname, *, limited_capi):
def parse_arg(self, argname, displayname, *, limited_capi, clinic):
return self.format_code("""
{paramname} = PyLong_AsVoidPtr({argname});
if (!{paramname} && PyErr_Occurred()) {{{{
Expand Down Expand Up @@ -75,7 +75,7 @@ class wchar_t_return_converter(CReturnConverter):
data.return_conversion.append(
'return_value = PyUnicode_FromOrdinal(_return_value);\n')
[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=ff031be44ab3250d]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=01864ad0c19dd001]*/

/*[clinic input]
module msvcrt
Expand Down
4 changes: 2 additions & 2 deletions PC/winreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class HKEY_converter(CConverter):
converter = 'clinic_HKEY_converter'
broken_limited_capi = True

def parse_arg(self, argname, displayname, *, limited_capi):
def parse_arg(self, argname, displayname, *, limited_capi, clinic):
assert not limited_capi
return self.format_code("""
if (!{converter}(_PyModule_GetState(module), {argname}, &{paramname})) {{{{
Expand Down Expand Up @@ -252,7 +252,7 @@ class self_return_converter(CReturnConverter):
data.return_conversion.append(
'return_value = (PyObject *)_return_value;\n')
[python start generated code]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=4979f33998ffb6f8]*/
/*[python end generated code: output=da39a3ee5e6b4b0d input=b315ae970b9dbabd]*/

#include "clinic/winreg.c.h"

Expand Down
Loading
Loading