From 900274fe4a9ba562ad0c0451759cd30afb71c92f Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 5 Mar 2025 11:26:09 +0200 Subject: [PATCH] gh-130824: Clean up test wrappers for PyLong_*AndOverflow functions --- Modules/_testlimitedcapi/long.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Modules/_testlimitedcapi/long.c b/Modules/_testlimitedcapi/long.c index d896435c99a169..34bc7331da9247 100644 --- a/Modules/_testlimitedcapi/long.c +++ b/Modules/_testlimitedcapi/long.c @@ -625,8 +625,7 @@ pylong_aslongandoverflow(PyObject *module, PyObject *arg) int overflow = UNINITIALIZED_INT; long value = PyLong_AsLongAndOverflow(arg, &overflow); if (value == -1 && PyErr_Occurred()) { - // overflow can be 0 if a separate exception occurred - assert(overflow == -1 || overflow == 0); + assert(overflow == 0); return NULL; } return Py_BuildValue("li", value, overflow); @@ -672,8 +671,7 @@ pylong_aslonglongandoverflow(PyObject *module, PyObject *arg) int overflow = UNINITIALIZED_INT; long long value = PyLong_AsLongLongAndOverflow(arg, &overflow); if (value == -1 && PyErr_Occurred()) { - // overflow can be 0 if a separate exception occurred - assert(overflow == -1 || overflow == 0); + assert(overflow == 0); return NULL; } return Py_BuildValue("Li", value, overflow);