summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@gmail.com>2017-03-12 21:04:06 (GMT)
committerGitHub <noreply@github.com>2017-03-12 21:04:06 (GMT)
commitfa448de97de85d242491d7ad259ade0732f05db8 (patch)
tree2ed20bef2ec7b5eeb230212968d293b2de49e884 /Lib/test
parentaac875fa2f03cab61ceeaa2621c4c5534c7bcfc2 (diff)
downloadcpython-fa448de97de85d242491d7ad259ade0732f05db8.zip
cpython-fa448de97de85d242491d7ad259ade0732f05db8.tar.gz
cpython-fa448de97de85d242491d7ad259ade0732f05db8.tar.bz2
Fix wrapping into StopIteration of return values in generators and coroutines (#644) (#647)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_coroutines.py15
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):