From 0b13116a625d3a91e9f4507ed81f8b3575cdef8c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 23 Aug 2001 21:32:40 +0000 Subject: err_ovf(): only raise OverflowError when OverflowWarning was raised. --- Objects/intobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/intobject.c b/Objects/intobject.c index 847c74d..77d7e38 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -27,7 +27,8 @@ static int err_ovf(char *msg) { if (PyErr_Warn(PyExc_OverflowWarning, msg) < 0) { - PyErr_SetString(PyExc_OverflowError, msg); + if (PyErr_ExceptionMatches(PyExc_OverflowWarning)) + PyErr_SetString(PyExc_OverflowError, msg); return 1; } else -- cgit v0.12