[tor-commits] [stem/master] Make `Controller.get_info` asynchronous

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


commit 4dc6ae158e60ab021d80fd6f95ede14838a0c4b1
Author: Illia Volochii <illia.volochii at gmail.com>
Date:   Wed Apr 15 21:50:03 2020 +0300

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

diff --git a/stem/control.py b/stem/control.py
index d5e0d0ba..dd723db4 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -1115,7 +1115,7 @@ class Controller(BaseController):
       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]]:
+  async def get_info(self, params: Union[str, Sequence[str]], default: Any = UNDEFINED, get_bytes: bool = False) -> Union[str, Dict[str, str]]:
     """
     get_info(params, default = UNDEFINED, get_bytes = False)
 
@@ -1192,8 +1192,8 @@ class Controller(BaseController):
         return list(reply.values())[0]
 
     try:
-      response = stem.response._convert_to_getinfo(self.msg('GETINFO %s' % ' '.join(param_set)))
-      response._assert_matches(param_set)
+      response = stem.response._convert_to_getinfo(await self.msg('GETINFO %s' % ' '.join(params)))
+      response._assert_matches(params)
 
       # usually we want unicode values under python 3.x
 





More information about the tor-commits mailing list