cpython: 3fe1c7ad3b58 (original) (raw)
Mercurial > cpython
changeset 101227:3fe1c7ad3b58
Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL pointer. [#26811]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Wed, 04 May 2016 21:42:52 +0300 |
parents | 89116bd505cb(current diff)a98ef122d73d(diff) |
children | f7d34f271104 |
files | Misc/NEWS Objects/descrobject.c |
diffstat | 2 files changed, 18 insertions(+), 15 deletions(-)[+] [-] Misc/NEWS 3 Objects/descrobject.c 30 |
line wrap: on
line diff
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Release date: tba Core and Builtins ----------------- +- Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL
- Issue #20120: Use RawConfigParser for .pypirc parsing, removing support for interpolation unintentionally added with move to Python 3. Behavior no longer does any
--- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1386,27 +1386,27 @@ property_descr_get(PyObject *self, PyObj return NULL; } args = cached_args;
- if (!args || Py_REFCNT(args) != 1) {
Py_CLEAR(cached_args);[](#l2.8)
if (!(cached_args = args = PyTuple_New(1)))[](#l2.9)
- cached_args = NULL;
- if (!args) {
args = PyTuple_New(1);[](#l2.12)
if (!args)[](#l2.13) return NULL;[](#l2.14)
}_PyObject_GC_UNTRACK(args);[](#l2.15)
- Py_INCREF(args);
- assert (Py_REFCNT(args) == 2); Py_INCREF(obj); PyTuple_SET_ITEM(args, 0, obj); ret = PyObject_Call(gs->prop_get, args, NULL);
- if (args == cached_args) {
if (Py_REFCNT(args) == 2) {[](#l2.23)
obj = PyTuple_GET_ITEM(args, 0);[](#l2.24)
PyTuple_SET_ITEM(args, 0, NULL);[](#l2.25)
Py_XDECREF(obj);[](#l2.26)
}[](#l2.27)
else {[](#l2.28)
Py_CLEAR(cached_args);[](#l2.29)
}[](#l2.30)
- if (cached_args == NULL && Py_REFCNT(args) == 1) {
assert(Py_SIZE(args) == 1);[](#l2.32)
assert(PyTuple_GET_ITEM(args, 0) == obj);[](#l2.33)
cached_args = args;[](#l2.34)
}Py_DECREF(obj);[](#l2.35)