Skip to content

Commit

Permalink
Revert PyErr_ExceptionMatches
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Dec 9, 2023
1 parent 5768395 commit ad84c4a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Modules/mathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,8 @@ loghelper(PyObject* arg, double (*func)(double))

x = PyLong_AsDouble(arg);
if (x == -1.0) {
if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
/* Here the conversion to double overflowed, but it's possible
to compute the log anyway. Clear the exception and continue. */
PyErr_Clear();
Expand Down

0 comments on commit ad84c4a

Please sign in to comment.