mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-130824: Clean up test wrappers for PyLong_*AndOverflow functions (GH-130871)
This commit is contained in:
parent
90130807d9
commit
63d25f8d0c
1 changed files with 2 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue