[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

James William Pye report at bugs.python.org
Mon Mar 16 03:34:37 CET 2009


James William Pye <x at jwp.name> added the comment:

I tested the attached script against v2.

It further identifies consistencies between nested with-statements and
nested() that should exist(and do in v2). It answers the question: what
is the effect of a SkipStatement exception on another, outer CM?

with nested(outer(), trap(), fail()):
 ...

That is, validate that outer()'s __exit__ invocation is not given an
exception.

This is probably an obvious effect of the patch, but I think it merited
a test.

----------
Added file: http://bugs.python.org/file13346/outer_sees_no_exc.py

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


More information about the Python-bugs-list mailing list