[Python-Dev] Traceback object has no class? (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Apr 11 12:43:14 CEST 2010


I thought type-class unification was supposed to mean that all objects now have a class attribute. But traceback objects don't seem to:

import sys

try: raise ValueError except ValueError: tb = sys.exc_info()[2] print tb print tb.class

results in:

% python2.6 traceback_class.py <traceback object at 0x82dc8> Traceback (most recent call last): File "traceback_class.py", line 8, in print tb.class AttributeError: class

-- Greg



More information about the Python-Dev mailing list