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

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


commit 0355c06962d9c807b6330d36eb363d6cfb5ba162
Author: Illia Volochii <illia.volochii at gmail.com>
Date:   Tue Apr 21 22:27:26 2020 +0300

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

diff --git a/stem/control.py b/stem/control.py
index b36497a5..f8fae01e 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -3320,7 +3320,7 @@ class Controller(BaseController):
 
     return feature in self._enabled_features
 
-  def enable_feature(self, features: Union[str, Sequence[str]]) -> None:
+  async def enable_feature(self, features: Union[str, Sequence[str]]) -> None:
     """
     Enables features that are disabled by default to maintain backward
     compatibility. Once enabled, a feature cannot be disabled and a new
@@ -3337,7 +3337,7 @@ class Controller(BaseController):
     if isinstance(features, (bytes, str)):
       features = [features]
 
-    response = stem.response._convert_to_single_line(self.msg('USEFEATURE %s' % ' '.join(features)))
+    response = stem.response._convert_to_single_line(await self.msg('USEFEATURE %s' % ' '.join(features)))
 
     if not response.is_ok():
       if response.code == '552':





More information about the tor-commits mailing list