Skip to content
Prev Previous commit
Next Next commit
Use Py_NewRef where appropriate
  • Loading branch information
encukou committed Dec 8, 2020
commit f302029dfb40eda74f32b67580378bbf7cedb9f7
3 changes: 1 addition & 2 deletions Modules/_csv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1409,8 +1409,7 @@ csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args)
self->rec_len = 0;
self->num_fields = 0;

self->error_obj = module_state->error_obj;
Py_INCREF(self->error_obj);
self->error_obj = Py_NewRef(module_state->error_obj);

if (!PyArg_UnpackTuple(args, "", 1, 2, &output_file, &dialect)) {
Py_DECREF(self);
Expand Down