How to except the unexpected?

James Stroud jstroud at ucla.edu
Sat Mar 4 01:27:08 CET 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