(original) (raw)
changeset: 68658:8945e087a5a6 user: Ross Lagerwall rosslagerwall@gmail.com date: Thu Mar 17 21:54:07 2011 +0200 files: Modules/posixmodule.c description: Issue #10812: Revert os.lseek change. diff -r 525320df8afb -r 8945e087a5a6 Modules/posixmodule.c --- a/Modules/posixmodule.c Thu Mar 17 20:20:30 2011 +0200 +++ b/Modules/posixmodule.c Thu Mar 17 21:54:07 2011 +0200 @@ -6080,7 +6080,8 @@ #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 @@ } #endif /* SEEK_END */ +#if !defined(HAVE_LARGEFILE_SUPPORT) + pos = PyLong_AsLong(posobj); +#else + pos = PyLong_AsLongLong(posobj); +#endif if (PyErr_Occurred()) return NULL; /rosslagerwall@gmail.com