WindowsError is not available on linux?

Aahz aahz at
Wed Nov 18 20:53:34 CET 2009

In article <mailman.599.1258510702.2873.python-list at>,
Peng Yu  <pengyu.ut at> wrote:
>It's not clear to me whether WindowsError is available on linux or
>not, after I read the document. 

Here's what I told a co-worker to do yesterday:

if == 'nt':
    DiskError = (OSError, WindowsError)
    DiskError = WindowsError

except DiskError:
Aahz (aahz at           <*>

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it."  --Brian W. Kernighan

More information about the Python-list mailing list