Skip to content

Commit a4861bf

Browse files
serhiy-storchakaencukou
authored andcommitted
pythongh-130824: Clean up test wrappers for PyLong_*AndOverflow functions (pythonGH-130871)
1 parent 21a1ef8 commit a4861bf

File tree

1 file changed

+2
-4
lines changed
  • Modules/_testlimitedcapi

1 file changed

+2
-4
lines changed

Modules/_testlimitedcapi/long.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,7 @@ pylong_aslongandoverflow(PyObject *module, PyObject *arg)
625625
int overflow = UNINITIALIZED_INT;
626626
long value = PyLong_AsLongAndOverflow(arg, &overflow);
627627
if (value == -1 && PyErr_Occurred()) {
628-
// overflow can be 0 if a separate exception occurred
629-
assert(overflow == -1 || overflow == 0);
628+
assert(overflow == 0);
630629
return NULL;
631630
}
632631
return Py_BuildValue("li", value, overflow);
@@ -672,8 +671,7 @@ pylong_aslonglongandoverflow(PyObject *module, PyObject *arg)
672671
int overflow = UNINITIALIZED_INT;
673672
long long value = PyLong_AsLongLongAndOverflow(arg, &overflow);
674673
if (value == -1 && PyErr_Occurred()) {
675-
// overflow can be 0 if a separate exception occurred
676-
assert(overflow == -1 || overflow == 0);
674+
assert(overflow == 0);
677675
return NULL;
678676
}
679677
return Py_BuildValue("Li", value, overflow);

0 commit comments

Comments
 (0)