On Sep 19, 9:40 am, Alexandru  Mosoi <[EMAIL PROTECTED]> wrote:
> i have a generator that raises an exception when calling next(),
> however if I try to catch the exception and print the traceback i get
> only the line where next() was called
>
> while True:
>   try:
>     iterator.next()
>   except StopIteration:
>     break
>   except Exception, e:
>     traceback.print_exc()
>
> how do I get the traceback starting from where exception was raised in
> first place?

What happens if you simply remove the 'except Exception' clause? It
should print the entire traceback by default.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to