mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-103488: Use return-offset, not yield-offset. (GH-103502)
* Use return-offset, not yield-offset, so that instruction pointer is correct when sending to a generator or coroutine.
This commit is contained in:
parent
4307feaddc
commit
efb8a2553c
6 changed files with 455 additions and 414 deletions
|
@ -225,7 +225,22 @@ class GeneratorTest(unittest.TestCase):
|
|||
gi = f()
|
||||
self.assertIsNone(gi.gi_frame.f_back)
|
||||
|
||||
def test_issue103488(self):
|
||||
|
||||
def gen_raises():
|
||||
yield
|
||||
raise ValueError()
|
||||
|
||||
def loop():
|
||||
try:
|
||||
for _ in gen_raises():
|
||||
if True is False:
|
||||
return
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
#This should not raise
|
||||
loop()
|
||||
|
||||
class ExceptionTest(unittest.TestCase):
|
||||
# Tests for the issue #23353: check that the currently handled exception
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue