summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/intobject.c3
1 files changed, 2 insertions, 1 deletions
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