summaryrefslogtreecommitdiffstats
path: root/PC/msvcrtmodule.c
diff options
context:
space:
mode:
authorOleg Iarygin <oleg@arhadthedev.net>2022-07-04 13:09:34 (GMT)
committerGitHub <noreply@github.com>2022-07-04 13:09:34 (GMT)
commit21f6b4d7838fa16341faf735456b05f8ede9e4f9 (patch)
tree5e1eca3250b7ce4cc3b40339afa2ac97348160e4 /PC/msvcrtmodule.c
parenta391b74dbed085e4c8b922c79dcf7a9d9e72d3df (diff)
downloadcpython-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.c10
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