diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2011-03-17 19:54:07 (GMT) |
---|---|---|
committer | Ross Lagerwall <rosslagerwall@gmail.com> | 2011-03-17 19:54:07 (GMT) |
commit | 8e7496785563411d0488ffa3718b265ee24322d3 (patch) | |
tree | b48cfedc38b5e37dcb65cbdb2a5cb6998acdfbfd /Modules | |
parent | 7807c3545d9a6176ac0908a269481cf0eb3a60e6 (diff) | |
download | cpython-8e7496785563411d0488ffa3718b265ee24322d3.zip cpython-8e7496785563411d0488ffa3718b265ee24322d3.tar.gz cpython-8e7496785563411d0488ffa3718b265ee24322d3.tar.bz2 |
Issue #10812: Revert os.lseek change.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index cc908e2..0de6fdf 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6080,7 +6080,8 @@ posix_lseek(PyObject *self, PyObject *args) #else off_t pos, res; #endif - if (!PyArg_ParseTuple(args, "iO&i:lseek", &fd, _parse_off_t, &pos, &how)) + PyObject *posobj; + if (!PyArg_ParseTuple(args, "iOi:lseek", &fd, &posobj, &how)) return NULL; #ifdef SEEK_SET /* Turn 0, 1, 2 into SEEK_{SET,CUR,END} */ @@ -6091,6 +6092,11 @@ posix_lseek(PyObject *self, PyObject *args) } #endif /* SEEK_END */ +#if !defined(HAVE_LARGEFILE_SUPPORT) + pos = PyLong_AsLong(posobj); +#else + pos = PyLong_AsLongLong(posobj); +#endif if (PyErr_Occurred()) return NULL; |