bpo-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single argument (GH-17243)
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 7106014..7b13fa0 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -1631,7 +1631,7 @@
"invalid type");
return NULL;
}
- if (PySys_Audit("ctypes.addressof", "O", obj) < 0) {
+ if (PySys_Audit("ctypes.addressof", "(O)", obj) < 0) {
return NULL;
}
return PyLong_FromVoidPtr(((CDataObject *)obj)->b_ptr);
@@ -1651,7 +1651,7 @@
if (!PyArg_ParseTuple(args, "O&:PyObj_FromPtr", converter, &ob)) {
return NULL;
}
- if (PySys_Audit("ctypes.PyObj_FromPtr", "O", ob) < 0) {
+ if (PySys_Audit("ctypes.PyObj_FromPtr", "(O)", ob) < 0) {
return NULL;
}
Py_INCREF(ob);