From: Georg Brandl Date: Tue, 23 Oct 2007 18:25:20 +0000 (+0000) Subject: Remove redundant PyInt/PyLong checks. X-Git-Tag: v3.0a2~288 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b6538a86bae16b47b55af1e6cc2c8cf76c30f7e1;p=thirdparty%2FPython%2Fcpython.git Remove redundant PyInt/PyLong checks. --- diff --git a/Objects/fileobject.c b/Objects/fileobject.c index b4abac582ac8..9f63814ba18b 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -206,10 +206,7 @@ PyObject_AsFileDescriptor(PyObject *o) int fd; PyObject *meth; - if (PyInt_Check(o)) { - fd = PyInt_AsLong(o); - } - else if (PyLong_Check(o)) { + if (PyLong_Check(o)) { fd = PyLong_AsLong(o); } else if ((meth = PyObject_GetAttrString(o, "fileno")) != NULL) @@ -219,11 +216,7 @@ PyObject_AsFileDescriptor(PyObject *o) if (fno == NULL) return -1; - if (PyInt_Check(fno)) { - fd = PyInt_AsLong(fno); - Py_DECREF(fno); - } - else if (PyLong_Check(fno)) { + if (PyLong_Check(fno)) { fd = PyLong_AsLong(fno); Py_DECREF(fno); }