Message58164
| Author |
gvanrossum |
| Recipients |
amaury.forgeotdarc, christian.heimes, draghuram, facundobatista, gvanrossum, ianare |
| Date |
2007年12月03日.23:18:59 |
| SpamBayes Score |
0.019654255 |
| Marked as misclassified |
No |
| Message-id |
<ca471dc20712031511j1c6feebbp23b539acbe674499@mail.gmail.com> |
| In-reply-to |
<2c51ecee0712031425sb39cf4dscda2dead89a9c75d@mail.gmail.com> |
| Content |
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@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@bugs.python.org>
> <http://bugs.python.org/issue1545>
> __________________________________
> |
|