unboundlocalerror with cgi module

Felipe Almeida Lessa felipe.lessa at gmail.com
Mon Apr 10 14:39:01 EDT 2006


Em Seg, 2006-04-10 às 11:29 -0700, David Bear escreveu:
> However, the except block does not seem to catch the exception and an
> unboundlocalerror is thrown anyway. What am I missing?

See http://docs.python.org/tut/node10.html :

"""
A try statement may have more than one except clause, to specify
handlers for different exceptions. At most one handler will be executed.
Handlers only handle exceptions that occur in the corresponding try
clause, not in other handlers of the same try statement. An except
clause may name multiple exceptions as a parenthesized tuple, for
example:

... except (RuntimeError, TypeError, NameError):
...     pass
"""

-- 
Felipe.




More information about the Python-list mailing list