Commit 0b13116a authored by Guido van Rossum's avatar Guido van Rossum

err_ovf(): only raise OverflowError when OverflowWarning was raised.

parent 31960db5
...@@ -27,6 +27,7 @@ static int ...@@ -27,6 +27,7 @@ static int
err_ovf(char *msg) err_ovf(char *msg)
{ {
if (PyErr_Warn(PyExc_OverflowWarning, msg) < 0) { if (PyErr_Warn(PyExc_OverflowWarning, msg) < 0) {
if (PyErr_ExceptionMatches(PyExc_OverflowWarning))
PyErr_SetString(PyExc_OverflowError, msg); PyErr_SetString(PyExc_OverflowError, msg);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment