Commit 3a9e47a3 authored by Hanno Schlichting's avatar Hanno Schlichting

Avoid an infinite recursion in parent parent circles, if they are no longer...

Avoid an infinite recursion in parent parent circles, if they are no longer wrapped in all cases like with ExtensionClass 4.0
parent 442c205d
......@@ -636,13 +636,15 @@ Wrapper_acquire(Wrapper *self, PyObject *oname,
acquisition wrapper in the first place (see above). */
else if ((r = PyObject_GetAttr(self->container, py__parent__)))
{
ASSIGN(self->container, newWrapper(self->container, r,
(PyTypeObject*)&Wrappertype));
/* Don't search the container when the parent of the parent
is the same object as 'self' */
if (WRAPPER(r)->obj == WRAPPER(self)->obj)
sco=0;
if (r == WRAPPER(self)->obj)
sco=0;
else if (WRAPPER(r)->obj == WRAPPER(self)->obj)
sco=0;
ASSIGN(self->container, newWrapper(self->container, r,
(PyTypeObject*)&Wrappertype));
Py_DECREF(r); /* don't need __parent__ anymore */
......
......@@ -2389,7 +2389,10 @@ def test___parent__aq_parent_circles():
Traceback (most recent call last):
...
AttributeError: non_existant_attr
"""
# XXX: disabled
"""
>>> y.non_existant_attr
Traceback (most recent call last):
...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment