• svelankar's avatar
    bpo-29692: contextlib.contextmanager may incorrectly unchain RuntimeError (GH-949) · 00c75e9a
    svelankar yazdı
    contextlib._GeneratorContextManager.__exit__ includes a special case to deal with
    PEP 479 RuntimeErrors created when `StopIteration` is thrown into the context
    manager body.
    
    Previously this check was too permissive, and undid one level of chaining on *all*
    RuntimeError instances, not just those that wrapped a StopIteration instance.
    00c75e9a
test_contextlib.py 30.5 KB