##// END OF EJS Templates
BUG: Partial fix for the case of old-style extension types that do not descend from object, like the VTK types. Still need to work on getting a real MRO for them.
Robert Kern -
Show More
@@ -293,8 +293,14 b' def _get_mro(obj_class):'
293 """
293 """
294 if not hasattr(obj_class, '__mro__'):
294 if not hasattr(obj_class, '__mro__'):
295 # Old-style class. Mix in object to make a fake new-style class.
295 # Old-style class. Mix in object to make a fake new-style class.
296 obj_class = type(obj_class.__name__, (obj_class, object), {})
296 try:
297 mro = obj_class.__mro__[1:-1]
297 obj_class = type(obj_class.__name__, (obj_class, object), {})
298 except TypeError:
299 # Old-style extension type that does not descend from object.
300 # FIXME: try to construct a more thorough MRO.
301 mro = [obj_class]
302 else:
303 mro = obj_class.__mro__[1:-1]
298 else:
304 else:
299 mro = obj_class.__mro__
305 mro = obj_class.__mro__
300 return mro
306 return mro
General Comments 0
You need to be logged in to leave comments. Login now