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

[tor-commits] [stem/master] Make reconnecting asynchronous



commit 1447f538903a3f11ba5dfd8fffc65e6136b7a715
Author: Illia Volochii <illia.volochii@xxxxxxxxx>
Date:   Wed Apr 15 21:02:01 2020 +0300

    Make reconnecting asynchronous
---
 stem/control.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/stem/control.py b/stem/control.py
index b7ebe740..0bf1b35c 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -1084,7 +1084,7 @@ class Controller(BaseController):
     import stem.connection
     await stem.connection.authenticate(self, *args, **kwargs)
 
-  def reconnect(self, *args: Any, **kwargs: Any) -> None:
+  async def reconnect(self, *args: Any, **kwargs: Any) -> None:
     """
     Reconnects and authenticates to our control socket.
 
@@ -1096,9 +1096,9 @@ class Controller(BaseController):
     """
 
     with self._msg_lock:
-      self.connect()
+      await self.connect()
       self.clear_cache()
-      self.authenticate(*args, **kwargs)
+      await self.authenticate(*args, **kwargs)
 
   @with_default()
   def get_info(self, params: Union[str, Sequence[str]], default: Any = UNDEFINED, get_bytes: bool = False) -> Union[str, Dict[str, str]]:



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