[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Fix `stem.connection._msg` operating a synchronous controller



commit 0be69071af23ed6cb753188160e29bfbcfab328c
Author: Illia Volochii <illia.volochii@xxxxxxxxx>
Date:   Thu Apr 30 19:30:52 2020 +0300

    Fix `stem.connection._msg` operating a synchronous controller
---
 stem/connection.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/stem/connection.py b/stem/connection.py
index 3d240070..c44fddb1 100644
--- a/stem/connection.py
+++ b/stem/connection.py
@@ -1025,7 +1025,10 @@ async def _msg(controller: Union[stem.control.BaseController, stem.socket.Contro
     await controller.send(message)
     return await controller.recv()
   else:
-    return await controller.msg(message)
+    message = controller.msg(message)
+    if asyncio.iscoroutine(message):
+      message = await message
+    return message
 
 
 def _connection_for_default_port(address: str) -> stem.socket.ControlPort:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits