cpython: c1d0df056c19 (original) (raw)

Mercurial > cpython

changeset 104273:c1d0df056c19

merge 3.6 (#26617) [#26617]

Benjamin Peterson benjamin@python.org
date Tue, 04 Oct 2016 00:00:35 -0700
parents 8c005be54305(current diff)520cb70ecb90(diff)
children 3fed30fa37f4
files Misc/NEWS
diffstat 3 files changed, 24 insertions(+), 13 deletions(-)[+] [-] Lib/test/test_weakref.py 8 Misc/NEWS 2 Objects/typeobject.c 27

line wrap: on

line diff

--- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -845,6 +845,14 @@ class ReferencesTestCase(TestBase): with self.assertRaises(AttributeError): ref1.callback = lambda ref: None

+ class SubclassableWeakrefTestCase(TestBase):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,8 @@ What's New in Python 3.7.0 alpha 1 Core and Builtins ----------------- +- Issue #26617: Fix crash when GC runs during weakref callbacks. +

--- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1136,11 +1136,6 @@ subtype_dealloc(PyObject *self) Py_TRASHCAN_SAFE_BEGIN(self); --_PyTrash_delete_nesting; -- tstate->trash_delete_nesting;

/* Find the nearest base with a different tp_dealloc */ base = type; @@ -1151,30 +1146,36 @@ subtype_dealloc(PyObject *self) has_finalizer = type->tp_finalize || type->tp_del;

-

+

if (type->tp_del) {