mirror of
https://github.com/python/cpython.git
synced 2026-01-08 08:22:41 +00:00
bpo-36150: Fix possible assertion failures due to _ctypes.c's PyCData_reduce(). (GH-12106)
This commit is contained in:
parent
48600c72c1
commit
5f2c50810a
1 changed files with 5 additions and 4 deletions
|
|
@ -2743,10 +2743,11 @@ PyCData_reduce(PyObject *myself, PyObject *args)
|
|||
"ctypes objects containing pointers cannot be pickled");
|
||||
return NULL;
|
||||
}
|
||||
return Py_BuildValue("O(O(NN))",
|
||||
_unpickle,
|
||||
Py_TYPE(myself),
|
||||
PyObject_GetAttrString(myself, "__dict__"),
|
||||
PyObject *dict = PyObject_GetAttrString(myself, "__dict__");
|
||||
if (dict == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return Py_BuildValue("O(O(NN))", _unpickle, Py_TYPE(myself), dict,
|
||||
PyBytes_FromStringAndSize(self->b_ptr, self->b_size));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue