mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
The cast function did not accept c_char_p or c_wchar_p instances
as first argument, and failed with a 'bad argument to internal function' error message.
This commit is contained in:
parent
fdb62f0e5f
commit
2244af596a
2 changed files with 18 additions and 2 deletions
|
@ -4597,11 +4597,11 @@ cast(void *ptr, PyObject *src, PyObject *ctype)
|
|||
if (obj->b_objects == NULL)
|
||||
goto failed;
|
||||
}
|
||||
Py_XINCREF(obj->b_objects);
|
||||
result->b_objects = obj->b_objects;
|
||||
if (result->b_objects) {
|
||||
if (result->b_objects && PyDict_Check(result->b_objects)) {
|
||||
PyObject *index;
|
||||
int rc;
|
||||
Py_INCREF(obj->b_objects);
|
||||
index = PyLong_FromVoidPtr((void *)src);
|
||||
if (index == NULL)
|
||||
goto failed;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue