Skip to content

Commit fa60555

Browse files
committed
address compiler warnings and errors
1 parent 7834214 commit fa60555

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

bson/_cbsonmodule.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ void handle_invalid_doc_error(PyObject* dict) {
16531653
PyObject *InvalidDocument = _error("InvalidDocument");
16541654
if (InvalidDocument == NULL) {
16551655
PyErr_Restore(etype, evalue, etrace);
1656-
return 0;
1656+
return;
16571657
}
16581658

16591659
if (PyErr_GivenExceptionMatches(etype, InvalidDocument)) {
@@ -1670,19 +1670,18 @@ void handle_invalid_doc_error(PyObject* dict) {
16701670
PyObject *dict_str = PyObject_Str(dict);
16711671
if (dict_str == NULL) {
16721672
Py_DECREF(msg);
1673-
return 0;
1673+
return;
16741674
}
1675-
PyObject *dict_str_utf8 = PyUnicode_AsUTF8(dict);
1675+
const char * dict_str_utf8 = PyUnicode_AsUTF8(dict);
16761676
Py_DECREF(dict_str);
16771677
if (dict_str_utf8 == NULL) {
16781678
Py_DECREF(msg);
1679-
return 0
1679+
return;
16801680
}
1681-
PyObject *msg_utf8 = PyUnicode_AsUTF8(msg);
1681+
const char * msg_utf8 = PyUnicode_AsUTF8(msg);
16821682
if (msg_utf8 == NULL) {
16831683
Py_DECREF(msg);
1684-
Py_DECREF(dict_str_utf8)
1685-
return 0
1684+
return;
16861685
}
16871686
PyObject *new_msg = PyUnicode_FromFormat("Invalid document %s | %s", dict_str_utf8, msg_utf8);
16881687
Py_DECREF(msg_utf8);

0 commit comments

Comments
 (0)