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

This commit is contained in:
Guido van Rossum 2001-08-23 21:32:40 +00:00
parent 31960db5a5
commit 0b13116a62

View file

@ -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;
} }