(original) (raw)
changeset: 99535:26859a7e385c branch: 3.5 user: Martin Panter vadmium+py@gmail.com date: Sat Dec 12 06:57:13 2015 +0000 files: Modules/_ctypes/cfield.c description: Issue #25845: Drop redundant checks leftover from int to long conversion diff -r 4f24a6dc934b -r 26859a7e385c Modules/_ctypes/cfield.c --- a/Modules/_ctypes/cfield.c Sat Dec 12 06:53:34 2015 +0000 +++ b/Modules/_ctypes/cfield.c Sat Dec 12 06:57:13 2015 +0000 @@ -1375,7 +1375,7 @@ Py_INCREF(value); return value; } - if (PyLong_Check(value) || PyLong_Check(value)) { + if (PyLong_Check(value)) { #if SIZEOF_VOID_P == SIZEOF_LONG_LONG *(wchar_t **)ptr = (wchar_t *)PyLong_AsUnsignedLongLongMask(value); #else @@ -1491,7 +1491,7 @@ _RET(value); } - if (!PyLong_Check(value) && !PyLong_Check(value)) { + if (!PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "cannot be converted to pointer"); return NULL; /vadmium+py@gmail.com