On Wed, Nov 18, 2009 at 2:53 PM, Aahz <[email protected]> wrote:
> In article <[email protected]>,
> Peng Yu <[email protected]> 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()
> --
Shouldn't that be the other way?
if os.name == 'nt':
DiskError = OSError, WindowsError
else :
DiskError = OSError
> Aahz ([email protected]) <*> http://www.pythoncraft.com/
>
> "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
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list