summaryrefslogtreecommitdiff
path: root/sys/src/cmd/python/Objects/fileobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/src/cmd/python/Objects/fileobject.c')
-rw-r--r--sys/src/cmd/python/Objects/fileobject.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/src/cmd/python/Objects/fileobject.c b/sys/src/cmd/python/Objects/fileobject.c
index 869ded916..124767ccd 100644
--- a/sys/src/cmd/python/Objects/fileobject.c
+++ b/sys/src/cmd/python/Objects/fileobject.c
@@ -553,8 +553,10 @@ file_seek(PyFileObject *f, PyObject *args)
#if !defined(HAVE_LARGEFILE_SUPPORT)
offset = PyInt_AsLong(offobj);
#else
- offset = PyLong_Check(offobj) ?
- PyLong_AsLongLong(offobj) : PyInt_AsLong(offobj);
+ if(PyLong_Check(offobj))
+ offset = PyLong_AsLongLong(offobj);
+ else
+ offset = PyInt_AsLong(offobj);
#endif
if (PyErr_Occurred())
return NULL;
@@ -610,9 +612,10 @@ file_truncate(PyFileObject *f, PyObject *args)
#if !defined(HAVE_LARGEFILE_SUPPORT)
newsize = PyInt_AsLong(newsizeobj);
#else
- newsize = PyLong_Check(newsizeobj) ?
- PyLong_AsLongLong(newsizeobj) :
- PyInt_AsLong(newsizeobj);
+ if(PyLong_Check(newsizeobj))
+ newsize = PyLong_AsLongLong(newsizeobj);
+ else
+ newsize = PyInt_AsLong(newsizeobj);
#endif
if (PyErr_Occurred())
return NULL;