diff options
author | Oleg Iarygin <oleg@arhadthedev.net> | 2022-07-04 13:09:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-04 13:09:34 (GMT) |
commit | 21f6b4d7838fa16341faf735456b05f8ede9e4f9 (patch) | |
tree | 5e1eca3250b7ce4cc3b40339afa2ac97348160e4 /PC/msvcrtmodule.c | |
parent | a391b74dbed085e4c8b922c79dcf7a9d9e72d3df (diff) | |
download | cpython-21f6b4d7838fa16341faf735456b05f8ede9e4f9.zip cpython-21f6b4d7838fa16341faf735456b05f8ede9e4f9.tar.gz cpython-21f6b4d7838fa16341faf735456b05f8ede9e4f9.tar.bz2 |
gh-94512: Fix forced arg format in AC-processed msvcrtmodule (GH-94514)
Diffstat (limited to 'PC/msvcrtmodule.c')
-rw-r--r-- | PC/msvcrtmodule.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c index 1f78d99..988d9c9 100644 --- a/PC/msvcrtmodule.c +++ b/PC/msvcrtmodule.c @@ -38,6 +38,14 @@ class HANDLE_converter(CConverter): type = 'void *' format_unit = '"_Py_PARSE_UINTPTR"' + def parse_arg(self, argname, displayname): + return """ + {paramname} = PyLong_AsVoidPtr({argname}); + if (!{paramname} && PyErr_Occurred()) {{{{ + goto exit; + }}}} + """.format(argname=argname, paramname=self.parser_name) + class HANDLE_return_converter(CReturnConverter): type = 'void *' @@ -66,7 +74,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=d102511df3cda2eb]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=1e8e9fa3538ec08f]*/ /*[clinic input] module msvcrt |