[issue11627] segfault raising an arbitrary object as an exception

Andreas Stührk report at bugs.python.org
Mon Mar 21 23:31:40 CET 2011


Andreas Stührk <andy-python at hammerhartes.de> added the comment:

On Mon, Mar 21, 2011 at 10:27 PM, Santoso Wijaya <report at bugs.python.org> wrote:
>
> Santoso Wijaya <santoso.wijaya at gmail.com> added the comment:
>
> Also, why is the print() in __new__ executed twice?

Because `PyErr_NormalizeException()` is called twice: First time when
the exceptions is raised, and then a second time when the exception is
caught. Because the previous call didn't instantiate an instance of a
exception, the second call will (try to) create a new exception
instance.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11627>
_______________________________________


More information about the Python-bugs-list mailing list