diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-05-31 14:03:49 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-05-31 14:03:49 (GMT) |
commit | 1ef17954ccc8530a32c359029e48c79af6fb0935 (patch) | |
tree | 7ef5b06fb8ba85d548780b5b11c272a2e201cb32 /Lib/test/test_contextlib.py | |
parent | 5ddbcfc53eb579d27157b539c271534ccabac26a (diff) | |
parent | a5bd2a18ce2bc0910357ff392b373174e0942e3b (diff) | |
download | cpython-1ef17954ccc8530a32c359029e48c79af6fb0935.zip cpython-1ef17954ccc8530a32c359029e48c79af6fb0935.tar.gz cpython-1ef17954ccc8530a32c359029e48c79af6fb0935.tar.bz2 |
Merge.
Diffstat (limited to 'Lib/test/test_contextlib.py')
-rw-r--r-- | Lib/test/test_contextlib.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py index e5eed21..efa9dcb 100644 --- a/Lib/test/test_contextlib.py +++ b/Lib/test/test_contextlib.py @@ -572,6 +572,12 @@ class TestExitStack(unittest.TestCase): stack.push(lambda *exc: 1/0) stack.push(lambda *exc: {}[1]) + def test_excessive_nesting(self): + # The original implementation would die with RecursionError here + with ExitStack() as stack: + for i in range(10000): + stack.callback(int) + def test_instance_bypass(self): class Example(object): pass cm = Example() |