summaryrefslogtreecommitdiff
path: root/Modules/_io/textio.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_io/textio.c')
-rw-r--r--Modules/_io/textio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 5501da4b3f..12a12f9ef0 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -2593,6 +2593,10 @@ textiowrapper_chunk_size_set(textio *self, PyObject *arg, void *context)
{
Py_ssize_t n;
CHECK_ATTACHED_INT(self);
+ if (arg == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
n = PyNumber_AsSsize_t(arg, PyExc_TypeError);
if (n == -1 && PyErr_Occurred())
return -1;