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

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


commit 4f63690766928018cec8b6dc0e3a4a9fe81dbd9d
Author: Illia Volochii <illia.volochii at gmail.com>
Date:   Mon Apr 20 22:14:15 2020 +0300

    Make `Controller.set_options` asynchronous
---
 stem/control.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/stem/control.py b/stem/control.py
index 708a413d..fda89224 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -2392,7 +2392,7 @@ class Controller(BaseController):
 
     self.set_options(dict([(entry, None) for entry in params]), True)
 
-  def set_options(self, params: Union[Mapping[str, Union[str, Sequence[str]]], Sequence[Tuple[str, Union[str, Sequence[str]]]]], reset: bool = False) -> None:
+  async def set_options(self, params: Union[Mapping[str, Union[str, Sequence[str]]], Sequence[Tuple[str, Union[str, Sequence[str]]]]], reset: bool = False) -> None:
     """
     Changes multiple tor configuration options via either a SETCONF or
     RESETCONF query. Both behave identically unless our value is None, in which
@@ -2445,7 +2445,7 @@ class Controller(BaseController):
         raise ValueError('Cannot set %s to %s since the value was a %s but we only accept strings' % (param, value, type(value).__name__))
 
     query = ' '.join(query_comp)
-    response = stem.response._convert_to_single_line(self.msg(query))
+    response = stem.response._convert_to_single_line(await self.msg(query))
 
     if response.is_ok():
       log.debug('%s (runtime: %0.4f)' % (query, time.time() - start_time))





More information about the tor-commits mailing list