R: [Python-Dev] Deprecating string exceptions
Martin v. Loewis
martin@v.loewis.de
28 Mar 2002 16:25:56 +0100
Skip Montanaro <skip@pobox.com> writes:
> Guido> One other, more practical reason to like the rule: "except
> Guido> Exception:" would become equivalent to "except:".
>> Just to make sure I'm not missing something (I probably am), I still think
> the recommended catch-all except construct should become "except
> StandardError:" with KeyboardInterrupt migrated to inherit from Exception
> instead of StandardError.
That is indeed a different issue. If you want to catch everything
(including KeyboardInterrupt), you need an except: clause, in which
case it is difficult to get at the exception object.
Regards,
Martin