Commit f5192615 authored by Georg Brandl's avatar Georg Brandl

#1479: Fix refleak in csv module (from rev 59062).

parent ceab6104
...@@ -793,14 +793,13 @@ Reader_iternext(ReaderObj *self) ...@@ -793,14 +793,13 @@ Reader_iternext(ReaderObj *self)
"newline inside string"); "newline inside string");
return NULL; return NULL;
} }
if (!PyUnicode_Check(lineobj)) if (!PyUnicode_Check(lineobj)) {
{ PyErr_Format(error_obj, "iterator should return "
PyErr_Format(error_obj, "strings, not %.200s (did you open "
"Iterator should return strings, " "the file in text mode?)",
"not %.200s "
"(did you open the file in text mode?)",
lineobj->ob_type->tp_name lineobj->ob_type->tp_name
); );
Py_DECREF(lineobj);
return NULL; return NULL;
} }
++self->line_num; ++self->line_num;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment