commit | cb4ae815b5db6c9339c7c77e1d45e850ed76e497 | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Wed Jul 13 21:07:49 2011 +0200 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Wed Jul 13 21:07:49 2011 +0200 |
tree | 6d5c578a5513961a83dd2261632acb305fd683eb | |
parent | fd060474e3cc51528d321bbd52323036f9fda80d [diff] [blame] |
Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a TextIOWrapper to a huge value, not TypeError.
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 73d83a1..abdbeb7 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c
@@ -2556,7 +2556,7 @@ { Py_ssize_t n; CHECK_INITIALIZED_INT(self); - n = PyNumber_AsSsize_t(arg, PyExc_TypeError); + n = PyNumber_AsSsize_t(arg, PyExc_ValueError); if (n == -1 && PyErr_Occurred()) return -1; if (n <= 0) {