Mercurial > cpython-lru_cache-weakref
diff Objects/fileobject.c @ 43649:da8230faf2ae
Remove redundant PyInt/PyLong checks.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Tue, 23 Oct 2007 18:25:20 +0000 |
| parents | 0067a6ab4854 |
| children | 00b136b7da84 |
line wrap: on
line diff
--- a/Objects/fileobject.c Tue Oct 23 18:21:41 2007 +0000 +++ b/Objects/fileobject.c Tue Oct 23 18:25:20 2007 +0000 @@ -206,10 +206,7 @@ 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 @@ 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); }
