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

atagar at torproject.org atagar at torproject.org
Thu Jul 16 01:28:59 UTC 2020


commit 0be69071af23ed6cb753188160e29bfbcfab328c
Author: Illia Volochii <illia.volochii at gmail.com>
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:





More information about the tor-commits mailing list