[issue1545] shutil fails when copying to NTFS in Linux
Guido van Rossum
report at bugs.python.org
Tue Dec 4 00:18:59 CET 2007
Guido van Rossum added the comment:
You're right, my code was wrong. Yours will be be correct if you add
"else:" in front of the raise. I also still prefer "WindowsError is
not None" over just "WindowsError".
On Dec 3, 2007 2:25 PM, Raghuram Devarakonda <report at bugs.python.org> wrote:
>
> Raghuram Devarakonda added the comment:
>
> > try:
> > ....
> > except os.error, err:
> > if WindowsError is not None or not isinstance(err, WindowsError):
> > raise # Pretend we didn't catch it
> > pass # Ignore it
>
> All the double negations are hurting when I try to understand above
> conditions. How about (in addition to the WindowsError name check):
>
> if WindowsError and isinstance(err, WindowsError):
> pass # ignore
>
> raise
>
>
> __________________________________
> Tracker <report at bugs.python.org>
> <http://bugs.python.org/issue1545>
> __________________________________
>
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1545>
__________________________________
More information about the Python-bugs-list
mailing list