summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-13 19:08:56 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-13 19:08:56 (GMT)
commit90ce72dd0684e55234b969f405826af7d810e5b0 (patch)
tree1fcbdb4e24b67f9976e4197fbcf635443b595c6a /Modules/_io
parent8442124693bf090b257b84b190aaa9a7024feffa (diff)
parentcb4ae815b5db6c9339c7c77e1d45e850ed76e497 (diff)
downloadcpython-90ce72dd0684e55234b969f405826af7d810e5b0.zip
cpython-90ce72dd0684e55234b969f405826af7d810e5b0.tar.gz
cpython-90ce72dd0684e55234b969f405826af7d810e5b0.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/_io')
-rw-r--r--Modules/_io/textio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 70d062b..1a32120 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -2618,7 +2618,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) {