diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-31 23:20:26 (GMT) |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-31 23:20:26 (GMT) |
| commit | 66f9fea782d330b28fe142ac4e58faff8a6f42d1 (patch) | |
| tree | 664127f167fb8d906cf7f7de7d1e1557fea0e647 /Modules/_io/textio.c | |
| parent | 1665a8d9313660ffdcf3eda3eb1e1cc4eefcacee (diff) | |
| download | cpython-66f9fea782d330b28fe142ac4e58faff8a6f42d1.zip cpython-66f9fea782d330b28fe142ac4e58faff8a6f42d1.tar.gz cpython-66f9fea782d330b28fe142ac4e58faff8a6f42d1.tar.bz2 | |
Merged revisions 77895-77896 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r77895 | antoine.pitrou | 2010-01-31 23:47:27 +0100 (dim., 31 janv. 2010) | 12 lines
Merged revisions 77890 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77890 | antoine.pitrou | 2010-01-31 23:26:04 +0100 (dim., 31 janv. 2010) | 7 lines
- Issue #6939: Fix file I/O objects in the `io` module to keep the original
file position when calling `truncate()`. It would previously change the
file position to the given argument, which goes against the tradition of
ftruncate() and other truncation APIs. Patch by Pascal Chambon.
........
................
r77896 | antoine.pitrou | 2010-02-01 00:12:29 +0100 (lun., 01 févr. 2010) | 3 lines
r77895 broke doctest.
................
Diffstat (limited to 'Modules/_io/textio.c')
| -rw-r--r-- | Modules/_io/textio.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index ba28d59..89d922c 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -2318,15 +2318,7 @@ textiowrapper_truncate(textio *self, PyObject *args) return NULL; Py_DECREF(res); - if (pos != Py_None) { - res = PyObject_CallMethodObjArgs((PyObject *) self, - _PyIO_str_seek, pos, NULL); - if (res == NULL) - return NULL; - Py_DECREF(res); - } - - return PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_truncate, NULL); + return PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_truncate, pos, NULL); } static PyObject * |
