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

This commit is contained in:
Serhiy Storchaka 2025-03-05 12:50:53 +02:00 committed by GitHub
parent 90130807d9
commit 63d25f8d0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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