except clause not catching IndexError

2006-02-22 Thread Derek Schuff
I'm sorry if this is a FAQ or on an easily-accesible "RTFM" style page, but i couldnt find it. I have some code like this: for line in f: toks = line.split() try: if int(toks[2],16) == qaddrs[i]+0x1000 and toks[0] == "200": #producer wri

Re: except clause not catching IndexError

2006-02-22 Thread Derek Schuff
Erwin S. Andreasen wrote: > Did you by any chance do something like: > > except ValueError, IndexError: > > at some point earlier in this function? That, when catching ValueError > assigns the resulting exception to IndexError (and so the following > except IndexError: wouldn't work as IndexErro