@@ -269,7 +269,7 @@ async def process_control_message(self, msg=None):
269269 assert self .session is not None
270270 assert self .control_thread is None or threading .current_thread () == self .control_thread
271271
272- msg = msg or await self .control_socket .arecv_multipart ()
272+ msg = msg or await self .control_socket .arecv_multipart (). wait ()
273273 idents , msg = self .session .feed_identities (msg )
274274 try :
275275 msg = self .session .deserialize (msg , content = True )
@@ -369,7 +369,7 @@ async def shell_channel_thread_main(self):
369369 async with self .shell_socket , create_task_group () as tg :
370370 try :
371371 while True :
372- msg = await self .shell_socket .arecv_multipart (copy = False )
372+ msg = await self .shell_socket .arecv_multipart (copy = False ). wait ()
373373 # deserialize only the header to get subshell_id
374374 # Keep original message to send to subshell_id unmodified.
375375 _ , msg2 = self .session .feed_identities (msg , copy = False )
@@ -384,7 +384,7 @@ async def shell_channel_thread_main(self):
384384 assert socket is not None
385385 if not socket .started .is_set ():
386386 await tg .start (socket .start )
387- await socket .asend_multipart (msg , copy = False )
387+ socket .asend_multipart (msg , copy = False )
388388 except Exception :
389389 self .log .error ("Invalid message" , exc_info = True ) # noqa: G201
390390 except BaseException :
@@ -444,8 +444,8 @@ async def process_shell_message(self, msg=None, socket=None):
444444 assert socket is None
445445 socket = self .shell_socket
446446
447- no_msg = msg is None if self ._is_test else not await socket .apoll (0 )
448- msg = msg or await socket .arecv_multipart (copy = False )
447+ no_msg = msg is None if self ._is_test else not await socket .apoll (0 ). wait ()
448+ msg = msg or await socket .arecv_multipart (copy = False ). wait ()
449449
450450 received_time = time .monotonic ()
451451 copy = not isinstance (msg [0 ], zmq .Message )
@@ -499,7 +499,7 @@ async def process_shell_message(self, msg=None, socket=None):
499499 try :
500500 result = handler (socket , idents , msg )
501501 if inspect .isawaitable (result ):
502- result = await result
502+ await result
503503 except Exception :
504504 self .log .error ("Exception in message handler:" , exc_info = True ) # noqa: G201
505505 except KeyboardInterrupt :
@@ -1090,8 +1090,8 @@ async def create_subshell_request(self, socket, ident, parent) -> None:
10901090 other_socket = await self .shell_channel_thread .manager .get_control_other_socket (
10911091 self .control_thread
10921092 )
1093- await other_socket .asend_json ({"type" : "create" })
1094- reply = await other_socket .arecv_json ()
1093+ await other_socket .asend_json ({"type" : "create" }). wait ()
1094+ reply = await other_socket .arecv_json (). wait ()
10951095
10961096 self .session .send (socket , "create_subshell_reply" , reply , parent , ident )
10971097
@@ -1114,8 +1114,8 @@ async def delete_subshell_request(self, socket, ident, parent) -> None:
11141114 other_socket = await self .shell_channel_thread .manager .get_control_other_socket (
11151115 self .control_thread
11161116 )
1117- await other_socket .asend_json ({"type" : "delete" , "subshell_id" : subshell_id })
1118- reply = await other_socket .arecv_json ()
1117+ await other_socket .asend_json ({"type" : "delete" , "subshell_id" : subshell_id }). wait ()
1118+ reply = await other_socket .arecv_json (). wait ()
11191119
11201120 self .session .send (socket , "delete_subshell_reply" , reply , parent , ident )
11211121
@@ -1131,8 +1131,8 @@ async def list_subshell_request(self, socket, ident, parent) -> None:
11311131 other_socket = await self .shell_channel_thread .manager .get_control_other_socket (
11321132 self .control_thread
11331133 )
1134- await other_socket .asend_json ({"type" : "list" })
1135- reply = await other_socket .arecv_json ()
1134+ await other_socket .asend_json ({"type" : "list" }). wait ()
1135+ reply = await other_socket .arecv_json (). wait ()
11361136
11371137 self .session .send (socket , "list_subshell_reply" , reply , parent , ident )
11381138
0 commit comments