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.[color=blue][color=green][color=darkred]
>>> import module
>>> raise module.Error("t est")[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
module.Error: test[color=blue][color=green][color=darkred]
>>> try:[/color][/color][/color]
.... raise module.Error("t est")
.... except:
.... import traceback
.... print traceback.print _exc()
....
Traceback (most recent call last):
File "<stdin>", line 2, in ?
Error: test
None[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
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
--
Jan Decaluwe - Resources bvba - http://jandecaluwe.com
Losbergenlaan 16, B-3010 Leuven, Belgium
Bored with EDA the way it is? Check this:
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.[color=blue][color=green][color=darkred]
>>> import module
>>> raise module.Error("t est")[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
module.Error: test[color=blue][color=green][color=darkred]
>>> try:[/color][/color][/color]
.... raise module.Error("t est")
.... except:
.... import traceback
.... print traceback.print _exc()
....
Traceback (most recent call last):
File "<stdin>", line 2, in ?
Error: test
None[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
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
--
Jan Decaluwe - Resources bvba - http://jandecaluwe.com
Losbergenlaan 16, B-3010 Leuven, Belgium
Bored with EDA the way it is? Check this: