diff options
Diffstat (limited to 'PC')
-rw-r--r-- | PC/msvcrtmodule.c | 9 | ||||
-rw-r--r-- | PC/winreg.c | 18 |
2 files changed, 15 insertions, 12 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c index afc810a..d7c2176 100644 --- a/PC/msvcrtmodule.c +++ b/PC/msvcrtmodule.c @@ -38,13 +38,14 @@ class HANDLE_converter(CConverter): type = 'void *' format_unit = '"_Py_PARSE_UINTPTR"' - def parse_arg(self, argname, displayname): - return """ + def parse_arg(self, argname, displayname, *, limited_capi): + return self.format_code(""" {paramname} = PyLong_AsVoidPtr({argname}); if (!{paramname} && PyErr_Occurred()) {{{{ goto exit; }}}} - """.format(argname=argname, paramname=self.parser_name) + """, + argname=argname) class HANDLE_return_converter(CReturnConverter): type = 'void *' @@ -74,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=1e8e9fa3538ec08f]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=ff031be44ab3250d]*/ /*[clinic input] module msvcrt diff --git a/PC/winreg.c b/PC/winreg.c index 767127d..77b8021 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -222,13 +222,15 @@ class HKEY_converter(CConverter): converter = 'clinic_HKEY_converter' broken_limited_capi = True - def parse_arg(self, argname, displayname): - return """ - if (!{converter}(_PyModule_GetState(module), {argname}, &{paramname})) {{{{ - goto exit; - }}}} - """.format(argname=argname, paramname=self.parser_name, - converter=self.converter) + def parse_arg(self, argname, displayname, *, limited_capi): + assert not limited_capi + return self.format_code(""" + if (!{converter}(_PyModule_GetState(module), {argname}, &{paramname})) {{{{ + goto exit; + }}}} + """, + argname=argname, + converter=self.converter) class HKEY_return_converter(CReturnConverter): type = 'HKEY' @@ -250,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=f8cb7034338aeaba]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=4979f33998ffb6f8]*/ #include "clinic/winreg.c.h" |