[Python-checkins] [python/cpython] 9b409f: [3.6] bpo-29692: contextlib.contextmanager may inc...

GitHub noreply at github.com
Thu Apr 13 05:50:23 EDT 2017


  Branch: refs/heads/3.6
  Home:   https://github.com/python/cpython
  Commit: 9b409ff41ceb2d7ea7e8d25a7bbf5eb7d46625f3
      https://github.com/python/cpython/commit/9b409ff41ceb2d7ea7e8d25a7bbf5eb7d46625f3
  Author: Mariatta <Mariatta at users.noreply.github.com>
  Date:   2017-04-13 (Thu, 13 Apr 2017)

  Changed paths:
    M Lib/contextlib.py
    M Lib/test/test_contextlib.py
    M Misc/NEWS

  Log Message:
  -----------
  [3.6] bpo-29692: contextlib.contextmanager may incorrectly unchain RuntimeError (GH-949) (#1105)

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.
(cherry picked from commit 00c75e9a45ff0366c185e9e8a2e23af5a35481b0)




More information about the Python-checkins mailing list