Skip to content

Commit 7834214

Browse files
committed
pass the dict
1 parent 005d942 commit 7834214

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bson/_cbsonmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ static int write_raw_doc(buffer_t buffer, PyObject* raw, PyObject* _raw_str) {
16471647

16481648
/* Update Invalid Document error message to include doc.
16491649
*/
1650-
void handle_invalid_doc_error() {
1650+
void handle_invalid_doc_error(PyObject* dict) {
16511651
PyObject *etype = NULL, *evalue = NULL, *etrace = NULL;
16521652
PyErr_Fetch(&etype, &evalue, &etrace);
16531653
PyObject *InvalidDocument = _error("InvalidDocument");
@@ -1808,7 +1808,7 @@ int write_dict(PyObject* self, buffer_t buffer,
18081808
Py_DECREF(key);
18091809
Py_DECREF(value);
18101810
if (PyErr_Occurred() && top_level) {
1811-
handle_invalid_doc_error();
1811+
handle_invalid_doc_error(dict);
18121812
}
18131813
return 0;
18141814
}
@@ -1832,7 +1832,7 @@ int write_dict(PyObject* self, buffer_t buffer,
18321832
Py_DECREF(value);
18331833
Py_DECREF(iter);
18341834
if (PyErr_Occurred() && top_level) {
1835-
handle_invalid_doc_error();
1835+
handle_invalid_doc_error(dict);
18361836
}
18371837
return 0;
18381838
}

0 commit comments

Comments
 (0)