From: Martin Panter Date: Sat, 12 Dec 2015 06:57:13 +0000 (+0000) Subject: Issue #25845: Drop redundant checks leftover from int to long conversion X-Git-Tag: v3.6.0a1~923^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0c0318cdc72cbc65014f3a550efb4c8a737b9e3;p=thirdparty%2FPython%2Fcpython.git Issue #25845: Drop redundant checks leftover from int to long conversion --- diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 3c7a52a6d9ed..8cb6d663e733 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1375,7 +1375,7 @@ Z_set(void *ptr, PyObject *value, Py_ssize_t size) 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 @@ P_set(void *ptr, PyObject *value, Py_ssize_t size) _RET(value); } - if (!PyLong_Check(value) && !PyLong_Check(value)) { + if (!PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "cannot be converted to pointer"); return NULL;