mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix reference counts for test_long_and_overflow.
This commit is contained in:
parent
e31d300664
commit
ed02b3f342
1 changed files with 6 additions and 0 deletions
|
@ -388,6 +388,8 @@ test_long_and_overflow(PyObject *self)
|
||||||
return raiseTestError("test_long_and_overflow",
|
return raiseTestError("test_long_and_overflow",
|
||||||
"overflow was not set to 0");
|
"overflow was not set to 0");
|
||||||
|
|
||||||
|
Py_DECREF(num);
|
||||||
|
|
||||||
/* a number smaller than LONG_MIN even on 64-bit platforms */
|
/* a number smaller than LONG_MIN even on 64-bit platforms */
|
||||||
num = PyLong_FromString("-FFFFFFFFFFFFFFFFFFFFFFFF", NULL, 16);
|
num = PyLong_FromString("-FFFFFFFFFFFFFFFFFFFFFFFF", NULL, 16);
|
||||||
if (num == NULL)
|
if (num == NULL)
|
||||||
|
@ -406,6 +408,8 @@ test_long_and_overflow(PyObject *self)
|
||||||
return raiseTestError("test_long_and_overflow",
|
return raiseTestError("test_long_and_overflow",
|
||||||
"overflow was not set to 0");
|
"overflow was not set to 0");
|
||||||
|
|
||||||
|
Py_DECREF(num);
|
||||||
|
|
||||||
num = PyLong_FromString("FF", NULL, 16);
|
num = PyLong_FromString("FF", NULL, 16);
|
||||||
if (num == NULL)
|
if (num == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -423,6 +427,8 @@ test_long_and_overflow(PyObject *self)
|
||||||
return raiseTestError("test_long_and_overflow",
|
return raiseTestError("test_long_and_overflow",
|
||||||
"overflow was set incorrectly");
|
"overflow was set incorrectly");
|
||||||
|
|
||||||
|
Py_DECREF(num);
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue