Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-84436 Add integration C API tests for immortal objects #103962

Merged
merged 14 commits into from
May 2, 2023
Prev Previous commit
Next Next commit
Adjust small int range
  • Loading branch information
corona10 committed May 2, 2023
commit 4fb67192280b979dcc7aeec892066b038b0c5af8
2 changes: 1 addition & 1 deletion Modules/_testcapi/immortal.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test_immortal_none(PyObject *self, PyObject *Py_UNUSED(ignored))
static PyObject *
test_immortal_small_ints(PyObject *self, PyObject *Py_UNUSED(ignored))
{
for(int i = -5; i < 255; i++) {
for(int i = -5; i <= 256; i++) {
PyObject *small_int = PyLong_FromLong(i);
if (!_Py_IsImmortal(small_int)) {
PyErr_Format(PyExc_RuntimeError, "Small int(%d) object should be the immportal object.", i);
Expand Down