asyncio.shield(arg, *, loop=None)
Wait for a future, shielding it from cancellation.
The statement:
res = yield from shield(something())
is exactly equivalent to the statement:
res = yield from something()
except that if the coroutine containing it is cancelled, the task running in something() is not cancelled. From the point of view of something(), the cancellation did not happen. But its caller is still cancelled, so the yield-from expression still raises CancelledError. Note: If somethi