summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@gmail.com>2017-03-12 19:53:07 (GMT)
committerGitHub <noreply@github.com>2017-03-12 19:53:07 (GMT)
commitb7c9150b68516878175e5373983189d6deea470c (patch)
treefa75438db1961d80c67986809c1c91e934089308 /Lib
parent2b27e2e6a35c3d3e369612b984017fe0d1bfcf0c (diff)
downloadcpython-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')
-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):