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) {
16571657 }
16581658
16591659 if (evalue && PyErr_GivenExceptionMatches (etype , InvalidDocument )) {
1660- PyObject * msg = PyObject_Str (evalue );
1660+ msg = PyObject_Str (evalue );
16611661 if (msg ) {
16621662 // Prepend doc to the existing message
1663- PyObject * dict_str = PyObject_Str (dict );
1663+ dict_str = PyObject_Str (dict );
16641664 if (dict_str == NULL ) {
16651665 goto cleanup ;
16661666 }
@@ -1672,15 +1672,17 @@ void handle_invalid_doc_error(PyObject* dict) {
16721672 if (msg_utf8 == NULL ) {
16731673 goto cleanup ;
16741674 }
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 );
16761676 Py_DECREF (evalue );
16771677 Py_DECREF (etype );
16781678 etype = InvalidDocument ;
16791679 InvalidDocument = NULL ;
16801680 if (new_msg ) {
16811681 evalue = new_msg ;
1682+ new_msg = NULL ;
16821683 } else {
16831684 evalue = msg ;
1685+ msg = NULL ;
16841686 }
16851687 }
16861688 PyErr_NormalizeException (& etype , & evalue , & etrace );
You can’t perform that action at this time.
0 commit comments