WindowsError is not available on linux?

exarkun at exarkun at
Wed Nov 18 21:58:51 CET 2009

On 07:53 pm, aahz at wrote:
>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
>    disk_operation()
>except DiskError:
>    logit()

This isn't necessary.  WindowsError subclasses OSError.


More information about the Python-list mailing list