Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b13116

Browse files
committed
err_ovf(): only raise OverflowError when OverflowWarning was raised.
1 parent 31960db commit 0b13116

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Objects/intobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ static int
2727
err_ovf(char *msg)
2828
{
2929
if (PyErr_Warn(PyExc_OverflowWarning, msg) < 0) {
30-
PyErr_SetString(PyExc_OverflowError, msg);
30+
if (PyErr_ExceptionMatches(PyExc_OverflowWarning))
31+
PyErr_SetString(PyExc_OverflowError, msg);
3132
return 1;
3233
}
3334
else

0 commit comments

Comments
 (0)