diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-13 19:07:49 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-13 19:07:49 (GMT) |
commit | cb4ae815b5db6c9339c7c77e1d45e850ed76e497 (patch) | |
tree | 6d5c578a5513961a83dd2261632acb305fd683eb /Modules | |
parent | fd060474e3cc51528d321bbd52323036f9fda80d (diff) | |
download | cpython-cb4ae815b5db6c9339c7c77e1d45e850ed76e497.zip cpython-cb4ae815b5db6c9339c7c77e1d45e850ed76e497.tar.gz cpython-cb4ae815b5db6c9339c7c77e1d45e850ed76e497.tar.bz2 |
Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a TextIOWrapper to a huge value, not TypeError.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_io/textio.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 @@ textiowrapper_chunk_size_set(textio *self, PyObject *arg, void *context) { 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) { |