https://github.com/python/cpython/commit/63d25f8d0c4f4626fb9f1131402d95fdaca34a57
commit: 63d25f8d0c4f4626fb9f1131402d95fdaca34a57
branch: main
author: Serhiy Storchaka <storch...@gmail.com>
committer: encukou <encu...@gmail.com>
date: 2025-03-05T11:50:53+01:00
summary:

gh-130824: Clean up test wrappers for PyLong_*AndOverflow functions (GH-130871)

files:
M Modules/_testlimitedcapi/long.c

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);

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to