mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Merged revisions 74921 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74921 | thomas.heller | 2009-09-18 22:05:44 +0200 (Fr, 18 Sep 2009) | 3 lines Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...) does now always result in NULL. ........
This commit is contained in:
parent
d7cb1b9119
commit
69b639f946
4 changed files with 10 additions and 3 deletions
|
@ -936,8 +936,11 @@ PyCPointerType_from_param(PyObject *type, PyObject *value)
|
|||
{
|
||||
StgDictObject *typedict;
|
||||
|
||||
if (value == Py_None)
|
||||
return PyLong_FromLong(0); /* NULL pointer */
|
||||
if (value == Py_None) {
|
||||
/* ConvParam will convert to a NULL pointer later */
|
||||
Py_INCREF(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
typedict = PyType_stgdict(type);
|
||||
assert(typedict); /* Cannot be NULL for pointer types */
|
||||
|
|
|
@ -547,6 +547,7 @@ PyTypeObject PyCArg_Type = {
|
|||
* C function call.
|
||||
*
|
||||
* 1. Python integers are converted to C int and passed by value.
|
||||
* Py_None is converted to a C NULL pointer.
|
||||
*
|
||||
* 2. 3-tuples are expected to have a format character in the first
|
||||
* item, which must be 'i', 'f', 'd', 'q', or 'P'.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue