"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):
Core and Builtins
-----------------
+- bpo-29600: Fix wrapping coroutine return values in StopIteration.
+
- bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused a
regression by revealing an inconsistency in how sys.path is initialized when
executing ``__main__`` from a zipfile, directory, or other import location.
PyObject *e;
if (value == NULL ||
- (!PyTuple_Check(value) &&
- !PyObject_TypeCheck(value, (PyTypeObject *) PyExc_StopIteration)))
+ (!PyTuple_Check(value) && !PyExceptionInstance_Check(value)))
{
/* Delay exception instantiation if we can */
PyErr_SetObject(PyExc_StopIteration, value);