Martin [gz] wrote:
> Actually, it's not quite that easy as there's now a straight
> _TypeEqualityDict<->TestCase reference link. I'll see if I can get
> upstream to accept some kind of fix.
In the interim we could add some ugly code to handle both versions:
tef_clear = getattr(type_equality_funcs, "clear", None):
if tef_clear is None: tef_instance_dict = getattr(type_equality_funcs, "__dict__", None)
if tef_instance_dict is not None:
tef_clear = tef_instance_dict.clear
if tef_clear is not None:
tef_clear()
Or perhaps we should just set the entire attribute to None, if it exists, and
rely on the assumption that by the time we do this self.assertEqual isn't going
to be invoked again:
sentinel = object()
if getattr(self, '_type_equality_funcs', sentinel) is not sentinel: self._type_equality_funcs = None
Martin [gz] wrote: ct<->TestCase reference link. I'll see if I can get
> Actually, it's not quite that easy as there's now a straight
> _TypeEqualityDi
> upstream to accept some kind of fix.
In the interim we could add some ugly code to handle both versions:
tef_clear = getattr( type_equality_ funcs, "clear", None):
tef_instance_ dict = getattr( type_equality_ funcs, "__dict__", None) dict.clear
if tef_clear is None:
if tef_instance_dict is not None:
tef_clear = tef_instance_
if tef_clear is not None:
tef_clear()
Or perhaps we should just set the entire attribute to None, if it exists, and
rely on the assumption that by the time we do this self.assertEqual isn't going
to be invoked again:
sentinel = object() equality_ funcs', sentinel) is not sentinel:
self._ type_equality_ funcs = None
if getattr(self, '_type_
-Andrew.