PEP 317: Eliminate Implicit Exception Instantiation

Bernhard Herzog bh at intevation.de
Mon Jun 9 10:46:59 EDT 2003


Steven Taschuk <staschuk at telusplanet.net> writes:

[...]
> Specification
> =============
> 
> The syntax of ``raise_stmt`` [3]_ is to be changed from ::
> 
>     raise_stmt ::= "raise" [expression ["," expression ["," expression]]]
> 
> to ::
> 
>     raise_stmt ::= "raise" [expression ["," expression]]
> 
[...]
> Warnings
> ''''''''
[...]
> The third warning is issued when a ``raise`` statement with three
> expressions is compiled.  (Not, note, when it is executed; this is
> important because the ``SyntaxError`` which this warning presages will
> occur at compile-time.)  The message for this warning is::
> 
>     raising with three arguments will be impossible in the future
> 
> These warnings are to appear in Python 2.4, and disappear in Python
> 3.0, when the conditions which cause them are simply errors.

How do I write code that raises and exception with an explicit traceback
object that works both with Python 2.4 and at least 2.3 (preferably 2.2
and 2.1 as well) and that does not issue warnings?

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                           http://www.mapit.de/




More information about the Python-list mailing list