mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
#1479: Fix refleak in csv module (from rev 59062).
This commit is contained in:
parent
ceab610469
commit
f519261563
1 changed files with 5 additions and 6 deletions
|
@ -793,14 +793,13 @@ Reader_iternext(ReaderObj *self)
|
|||
"newline inside string");
|
||||
return NULL;
|
||||
}
|
||||
if (!PyUnicode_Check(lineobj))
|
||||
{
|
||||
PyErr_Format(error_obj,
|
||||
"Iterator should return strings, "
|
||||
"not %.200s "
|
||||
"(did you open the file in text mode?)",
|
||||
if (!PyUnicode_Check(lineobj)) {
|
||||
PyErr_Format(error_obj, "iterator should return "
|
||||
"strings, not %.200s (did you open "
|
||||
"the file in text mode?)",
|
||||
lineobj->ob_type->tp_name
|
||||
);
|
||||
Py_DECREF(lineobj);
|
||||
return NULL;
|
||||
}
|
||||
++self->line_num;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue