PYTHON-1010 write_dict now checks the error indicator when exiting iteration loop

This commit is contained in:
aherlihy 2015-11-13 10:57:15 -05:00
parent 631e23eb95
commit af0daa4fc4

View File

@ -1485,6 +1485,9 @@ int write_dict(PyObject* self, buffer_t buffer,
Py_DECREF(value);
}
Py_DECREF(iter);
if (PyErr_Occurred()) {
return 0;
}
/* write null byte and fill in length */
if (!buffer_write_bytes(buffer, &zero, 1)) {