On 07:53 pm, a...@pythoncraft.com wrote:
In article <mailman.599.1258510702.2873.python-l...@python.org>,
Peng Yu  <pengyu...@gmail.com> 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 os.name == 'nt':
   DiskError = (OSError, WindowsError)
else:
   DiskError = WindowsError

try:
   disk_operation()
except DiskError:
   logit()

This isn't necessary.  WindowsError subclasses OSError.

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

Reply via email to