File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1657,10 +1657,10 @@ void handle_invalid_doc_error(PyObject* dict) {
1657
1657
}
1658
1658
1659
1659
if (evalue && PyErr_GivenExceptionMatches (etype , InvalidDocument )) {
1660
- PyObject * msg = PyObject_Str (evalue );
1660
+ msg = PyObject_Str (evalue );
1661
1661
if (msg ) {
1662
1662
// Prepend doc to the existing message
1663
- PyObject * dict_str = PyObject_Str (dict );
1663
+ dict_str = PyObject_Str (dict );
1664
1664
if (dict_str == NULL ) {
1665
1665
goto cleanup ;
1666
1666
}
@@ -1672,15 +1672,17 @@ void handle_invalid_doc_error(PyObject* dict) {
1672
1672
if (msg_utf8 == NULL ) {
1673
1673
goto cleanup ;
1674
1674
}
1675
- PyObject * new_msg = PyUnicode_FromFormat ("Invalid document %s | %s" , dict_str_utf8 , msg_utf8 );
1675
+ new_msg = PyUnicode_FromFormat ("Invalid document %s | %s" , dict_str_utf8 , msg_utf8 );
1676
1676
Py_DECREF (evalue );
1677
1677
Py_DECREF (etype );
1678
1678
etype = InvalidDocument ;
1679
1679
InvalidDocument = NULL ;
1680
1680
if (new_msg ) {
1681
1681
evalue = new_msg ;
1682
+ new_msg = NULL ;
1682
1683
} else {
1683
1684
evalue = msg ;
1685
+ msg = NULL ;
1684
1686
}
1685
1687
}
1686
1688
PyErr_NormalizeException (& etype , & evalue , & etrace );
You can’t perform that action at this time.
0 commit comments