summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-19 17:53:36 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-19 17:53:36 (GMT)
commit9053d7548592f4a583d99595d9bbf0050e920da4 (patch)
tree8935fcb38e555b1b3397a8d5843377220726341c /Modules
parent6214edd1bbf8aece44215b6a47fb2be4df73d42e (diff)
downloadcpython-9053d7548592f4a583d99595d9bbf0050e920da4.zip
cpython-9053d7548592f4a583d99595d9bbf0050e920da4.tar.gz
cpython-9053d7548592f4a583d99595d9bbf0050e920da4.tar.bz2
Merged revisions 68763,68773 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68763 | kristjan.jonsson | 2009-01-19 07:10:27 -0600 (Mon, 19 Jan 2009) | 2 lines Issue 4957 Let os.ftruncate raise OSError like documented. ........ r68773 | benjamin.peterson | 2009-01-19 09:51:27 -0600 (Mon, 19 Jan 2009) | 1 line simplify code ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 4909993..69b6978 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5114,10 +5114,8 @@ posix_ftruncate(PyObject *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS
res = ftruncate(fd, length);
Py_END_ALLOW_THREADS
- if (res < 0) {
- PyErr_SetFromErrno(PyExc_IOError);
- return NULL;
- }
+ if (res < 0)
+ return posix_error();
Py_INCREF(Py_None);
return Py_None;
}