J
Jan Decaluwe
Hi:
There is a difference between exception info formatting by
the interpreter versus the traceback module. For example,
say we define an exception Error in file module.py:
[jand@localhost jand]$ python
Python 2.3 (#1, Sep 12 2003, 15:05:00)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
.... raise module.Error("test")
.... except:
.... import traceback
.... print traceback.print_exc()
....
Traceback (most recent call last):
File "<stdin>", line 2, in ?
Error: test
None
In the second case, only the basename of the error is reported,
which is less clear. This is relevant because the unittest framework
uses the traceback module for exception reporting.
I believe the traceback module should be modified to mimic the
interpreter's behavior.
Regards, jan
There is a difference between exception info formatting by
the interpreter versus the traceback module. For example,
say we define an exception Error in file module.py:
[jand@localhost jand]$ python
Python 2.3 (#1, Sep 12 2003, 15:05:00)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
.... raise module.Error("test")
.... except:
.... import traceback
.... print traceback.print_exc()
....
Traceback (most recent call last):
File "<stdin>", line 2, in ?
Error: test
None
In the second case, only the basename of the error is reported,
which is less clear. This is relevant because the unittest framework
uses the traceback module for exception reporting.
I believe the traceback module should be modified to mimic the
interpreter's behavior.
Regards, jan