diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 8966f8cac82..beb36b5a08b 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -1020,7 +1020,7 @@ file_writelines(PyFileObject *f, PyObject *args) if (line == NULL) goto error; Py_DECREF(v); - PyList_SET_ITEM(list, i, v); + PyList_SET_ITEM(list, i, line); } }