Skip to content

Commit

Permalink
Merge pull request #384 from Distributive-Network/philippe/382-followup
Browse files Browse the repository at this point in the history
check if exception was set before clearing it
  • Loading branch information
philippedistributive authored Jul 17, 2024
2 parents 92eceae + a9f6d8c commit fb900e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/JSObjectProxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self
}
} else {
// clear any exception that was just set
PyErr_Clear();
if (PyErr_Occurred()) {
PyErr_Clear();
}

if (_PyUnicodeWriter_WriteASCIIString(&writer, "<cannot repr type>", 19) < 0) {
goto error;
Expand Down

0 comments on commit fb900e8

Please sign in to comment.