Agustin Villena schrieb:
Hi!is there anyway to show the class of a method in an exception's traceback? For example, the next code class Some(object): def foo(self,x): raise Exception(x) obj = Some() obj.foo("some arg") produces the next traceback Traceback (most recent call last): File "<string>", line 231, in run_nodebug File "G:\dev\exceptions\sample.py", line 7, in <module> obj.foo("some arg") File "G:\dev\exceptions\sample.py", line 3, in foo raise Exception(x) Exception: some arg I want to improve the line File "G:\dev\exceptions\sample.py", line 3, in foo to File "G:\dev\exceptions\sample.py", line 3, in Some.foo Is this improvement feasible
It should be. You can get a dictionary of the locals of an exception stack frame, of which you could extract the self-parameter's class.
Diez -- http://mail.python.org/mailman/listinfo/python-list
