Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions 15 Lib/test/test_coroutines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,21 @@ async def waiter(coro):
"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):
Expand Down
3 changes: 1 addition & 2 deletions 3 Objects/genobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,7 @@ _PyGen_SetStopIterationValue(PyObject *value)
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);
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.