summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-10-23 18:25:20 (GMT)
committerGeorg Brandl <georg@python.org>2007-10-23 18:25:20 (GMT)
commitb6538a86bae16b47b55af1e6cc2c8cf76c30f7e1 (patch)
tree865acd8874104a5bb276bd85fb3db9ae253cabaa /Objects/fileobject.c
parentd1cdf21cb92556b90bb210772bf1a19908e8314e (diff)
downloadcpython-b6538a86bae16b47b55af1e6cc2c8cf76c30f7e1.zip
cpython-b6538a86bae16b47b55af1e6cc2c8cf76c30f7e1.tar.gz
cpython-b6538a86bae16b47b55af1e6cc2c8cf76c30f7e1.tar.bz2
Remove redundant PyInt/PyLong checks.
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r--Objects/fileobject.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index b4abac5..9f63814 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);
}