Commit 0fadb843 authored by Jason Madden's avatar Jason Madden

Fix the last doctest errors in pure-python mode about parent circles. They...

Fix the last doctest errors in pure-python mode about parent circles. They were another manifestation of zopefoundation/ExtensionClass#3 and required a workaround.
parent 4053eadd
......@@ -628,7 +628,9 @@ class _Wrapper(ExtensionClass.Base):
def __call__(self, *args, **kwargs):
try:
call = getattr(type(self._obj), '__call__')
# Note we look this up on the completely unwrapped
# object, so as not to get a class
call = getattr(self.aq_base, '__call__')
except AttributeError:
# A TypeError is what the interpreter raises;
# AttributeError is allowed to percolate through the
......@@ -656,6 +658,9 @@ class _Acquirer(ExtensionClass.Base):
def __getattribute__(self, name):
try:
# workaround ExtensionClass bug #3
if name == '__parent__':
return object.__getattribute__(self, name)
return ExtensionClass.Base.__getattribute__(self, name)
except AttributeError:
# the doctests have very specific error message
......@@ -828,7 +833,7 @@ def aq_inContextOf(self, o, inner=True):
if 'PURE_PYTHON' not in os.environ: # pragma no cover
try:
from _Acquisition import *
from ._Acquisition import *
except ImportError:
pass
......
......@@ -2432,7 +2432,8 @@ def test___parent__aq_parent_circles():
>>> x.__parent__.aq_base is y.aq_base
True
>>> Acquisition.aq_parent(x) is y
True
>>> x.__parent__.__parent__ is x
True
......
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