@@ -1339,10 +1339,19 @@ async def _run_and_send(coro, caller_pid, ref):
13391339
13401340 try :
13411341 result = await coro
1342- erlang .send (caller_pid , (async_result , ref , (ok , result )))
1342+ try :
1343+ erlang .send (caller_pid , (async_result , ref , (ok , result )))
1344+ except erlang .ProcessError :
1345+ pass # Caller gone, nothing to do
13431346 except asyncio .CancelledError :
1344- erlang .send (caller_pid , (async_result , ref , (error , 'cancelled' )))
1347+ try :
1348+ erlang .send (caller_pid , (async_result , ref , (error , 'cancelled' )))
1349+ except erlang .ProcessError :
1350+ pass # Caller gone, nothing to do
13451351 except Exception as e :
13461352 import traceback
13471353 tb = traceback .format_exc ()
1348- erlang .send (caller_pid , (async_result , ref , (error , f'{ type (e ).__name__ } : { e } \n { tb } ' )))
1354+ try :
1355+ erlang .send (caller_pid , (async_result , ref , (error , f'{ type (e ).__name__ } : { e } \n { tb } ' )))
1356+ except erlang .ProcessError :
1357+ pass # Caller gone, nothing to do
0 commit comments