[Python-Dev] exit API? (original) (raw)

Guido van Rossum guido at python.org
Sat Mar 4 05:26:21 CET 2006


A few days ago there were rumbling noises that requiring exit to re-raise the exception (as I amended PEP 343 at the time) could lead to easily-missed bugs in exit handlers.

After thinking it over I think I agree and I think I'd like to change the API so that the exception is only ignored if exit returns a "true" value.

The easiest implementation is probably to just let the WITH_CLEANUP opcode do everything. This becomes a rather heavy opcode then but the alternative is to generate very hairy code (like the original patch did, full of ROT 4 choruses).

Any objections? I probably won't get to this until Monday.

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list