File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1103,6 +1103,21 @@ async def waiter(coro):
11031103 "coroutine is being awaited already" ):
11041104 waiter (coro ).send (None )
11051105
1106+ def test_await_16 (self ):
1107+ # See https://bugs.python.org/issue29600 for details.
1108+
1109+ async def f ():
1110+ return ValueError ()
1111+
1112+ async def g ():
1113+ try :
1114+ raise KeyError
1115+ except :
1116+ return await f ()
1117+
1118+ _ , result = run_async (g ())
1119+ self .assertIsNone (result .__context__ )
1120+
11061121 def test_with_1 (self ):
11071122 class Manager :
11081123 def __init__ (self , name ):
Original file line number Diff line number Diff line change @@ -574,8 +574,7 @@ _PyGen_SetStopIterationValue(PyObject *value)
574574 PyObject * e ;
575575
576576 if (value == NULL ||
577- (!PyTuple_Check (value ) &&
578- !PyObject_TypeCheck (value , (PyTypeObject * ) PyExc_StopIteration )))
577+ (!PyTuple_Check (value ) && !PyExceptionInstance_Check (value )))
579578 {
580579 /* Delay exception instantiation if we can */
581580 PyErr_SetObject (PyExc_StopIteration , value );
You can’t perform that action at this time.
0 commit comments