Skip to content

Commit

Permalink
Merge 368c394 into 66f70eb
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Mar 21, 2019
2 parents 66f70eb + 368c394 commit 01f8585
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aiorun.py
Expand Up @@ -63,12 +63,12 @@ async def coro_proxy():
"""
try:
result = await coro
try:
fut.set_result(result)
except asyncio.InvalidStateError:
logger.warning('Failed to set result.')
except (CancelledError, Exception) as e:
fut.set_exception(e)
if not fut.cancelled():
fut.set_exception(e)
else:
if not fut.cancelled():
fut.set_result(result)

new_coro = coro_proxy() # We'll taskify this one instead of coro.
_DO_NOT_CANCEL_COROS.add(new_coro) # The new task must not be cancelled.
Expand Down

0 comments on commit 01f8585

Please sign in to comment.