Jürgen A. Erhard <[email protected]> wrote:
> Peter's right, but instead of a print before the line, put a
> try/except around it, like
>
> try:
> set1 = set(list1)
> except TypeError:
> print list1
> raise
>
> This way, only the *actual* error triggers any output. With a general
> print before, you can get a lot of unnecessary output.
>
> Grits, J
>
Or even better:
try:
set1 = set(list1)
except TypeError:
print list1
import pdb; pdb.set_trace()
raise
Then the error will print the value of list1 and drop you into the debugger
so you can examine what's going on in more detail.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list