diff options
author | Guido van Rossum <guido@python.org> | 2001-08-23 21:32:40 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-08-23 21:32:40 (GMT) |
commit | 0b13116a625d3a91e9f4507ed81f8b3575cdef8c (patch) | |
tree | 1db9eaa27a2325da7b53279aac7d51b462c41da6 | |
parent | 31960db5a56d07584c53970799c530f42183f7b9 (diff) | |
download | cpython-0b13116a625d3a91e9f4507ed81f8b3575cdef8c.zip cpython-0b13116a625d3a91e9f4507ed81f8b3575cdef8c.tar.gz cpython-0b13116a625d3a91e9f4507ed81f8b3575cdef8c.tar.bz2 |
err_ovf(): only raise OverflowError when OverflowWarning was raised.
-rw-r--r-- | Objects/intobject.c | 3 |
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 |