How to except the unexpected?

James Stroud jstroud at ucla.edu
Fri Mar 3 19:27:08 EST 2006


Ben Caradoc-Davies wrote:
> James Stroud wrote:
> 
>> except URLError, HTTPException:
> 
> 
> Aieee! This catches only URLError and binds the name HTTPException to 
> the detail of that error. You must write
> 
> except (URLError, HTTPException):
> 
> to catch both.
> 

Oops.



More information about the Python-list mailing list