Remove redundant PyInt/PyLong checks.

This commit is contained in:
Georg Brandl 2007-10-23 18:25:20 +00:00
parent d1cdf21cb9
commit b6538a86ba
1 changed files with 2 additions and 9 deletions

View File

@ -206,10 +206,7 @@ PyObject_AsFileDescriptor(PyObject *o)
int fd; int fd;
PyObject *meth; PyObject *meth;
if (PyInt_Check(o)) { if (PyLong_Check(o)) {
fd = PyInt_AsLong(o);
}
else if (PyLong_Check(o)) {
fd = PyLong_AsLong(o); fd = PyLong_AsLong(o);
} }
else if ((meth = PyObject_GetAttrString(o, "fileno")) != NULL) else if ((meth = PyObject_GetAttrString(o, "fileno")) != NULL)
@ -219,11 +216,7 @@ PyObject_AsFileDescriptor(PyObject *o)
if (fno == NULL) if (fno == NULL)
return -1; return -1;
if (PyInt_Check(fno)) { if (PyLong_Check(fno)) {
fd = PyInt_AsLong(fno);
Py_DECREF(fno);
}
else if (PyLong_Check(fno)) {
fd = PyLong_AsLong(fno); fd = PyLong_AsLong(fno);
Py_DECREF(fno); Py_DECREF(fno);
} }