]> granicus.if.org Git - python/commitdiff
Remove redundant PyInt/PyLong checks.
authorGeorg Brandl <georg@python.org>
Tue, 23 Oct 2007 18:25:20 +0000 (18:25 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 23 Oct 2007 18:25:20 +0000 (18:25 +0000)
Objects/fileobject.c

index b4abac582ac8bbf2e5e0ad99055c16b0a1e1984e..9f63814ba18b5f408f01e09387a1e804c11146e7 100644 (file)
@@ -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);
                }