Dave Angel wrote:
> Worse, even if the exception cannot be thrown on a non-Windows 
> environment, leaving it undefined makes it very awkward to write 
> portable code.  An except clause that can never happen in a particular 
> environment is pretty innocent.  Or somebody can use a base class for 
> his except clause, to catch this error and other related ones.  But it 
> blows up if you explicitly use this exception.  I think that needs 
> documentation, at a minimum.

WindowsError is a subclass of OSError that contains additional Windows
specific error information. Just catch OSError and you are on the safe
side.

Christian

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to