]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-29587: Update gen.throw() to chain exceptions (#19823)
authorChris Jerdonek <chris.jerdonek@gmail.com>
Sat, 2 May 2020 01:14:19 +0000 (18:14 -0700)
committerGitHub <noreply@github.com>
Sat, 2 May 2020 01:14:19 +0000 (18:14 -0700)
commit02047265eb83a43ba18cc7fee81756f1a1a1f968
tree41f74764a8cfa3f824fcfea57a1b3ef17f7b4fd3
parentf40bd466bf14029e2687e36e965875adf9d4be1a
bpo-29587: Update gen.throw() to chain exceptions (#19823)

Before this commit, if an exception was active inside a generator
when calling gen.throw(), that exception was lost (i.e. there was
no implicit exception chaining).  This commit fixes that by
setting exc.__context__ when calling gen.throw(exc).
Lib/test/test_generators.py
Misc/NEWS.d/next/Core and Builtins/2020-04-30-00-50-25.bpo-29587.oEwSq.rst [new file with mode: 0644]
Objects/genobject.c