##// END OF EJS Templates
Fix pretty print of types when `__module__` is not available....
Bradley M. Froehle -
Show More
@@ -604,10 +604,16 b' def _re_pattern_pprint(obj, p, cycle):'
604
604
605 def _type_pprint(obj, p, cycle):
605 def _type_pprint(obj, p, cycle):
606 """The pprint for classes and types."""
606 """The pprint for classes and types."""
607 if obj.__module__ in ('__builtin__', 'exceptions'):
607 try:
608 mod = obj.__module__
609 except AttributeError:
610 # Heap allocated types might not have the module attribute.
611 return p.text(obj.__name__)
612
613 if mod in ('__builtin__', 'exceptions'):
608 name = obj.__name__
614 name = obj.__name__
609 else:
615 else:
610 name = obj.__module__ + '.' + obj.__name__
616 name = mod + '.' + obj.__name__
611 p.text(name)
617 p.text(name)
612
618
613
619
General Comments 0
You need to be logged in to leave comments. Login now