diff options
author | Yury Selivanov <yselivanov@gmail.com> | 2017-03-12 19:53:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-12 19:53:07 (GMT) |
commit | b7c9150b68516878175e5373983189d6deea470c (patch) | |
tree | fa75438db1961d80c67986809c1c91e934089308 /Lib/test/test_coroutines.py | |
parent | 2b27e2e6a35c3d3e369612b984017fe0d1bfcf0c (diff) | |
download | cpython-b7c9150b68516878175e5373983189d6deea470c.zip cpython-b7c9150b68516878175e5373983189d6deea470c.tar.gz cpython-b7c9150b68516878175e5373983189d6deea470c.tar.bz2 |
Fix wrapping into StopIteration of return values in generators and coroutines (#644)
Diffstat (limited to 'Lib/test/test_coroutines.py')
-rw-r--r-- | Lib/test/test_coroutines.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index b4c7b5b..a69583b 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -1103,6 +1103,21 @@ class CoroutineTest(unittest.TestCase): "coroutine is being awaited already"): waiter(coro).send(None) + def test_await_16(self): + # See https://bugs.python.org/issue29600 for details. + + async def f(): + return ValueError() + + async def g(): + try: + raise KeyError + except: + return await f() + + _, result = run_async(g()) + self.assertIsNone(result.__context__) + def test_with_1(self): class Manager: def __init__(self, name): |