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

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



commit 6c740552d968a7ab557d271371f68aae8e2d8110
Author: Illia Volochii <illia.volochii@xxxxxxxxx>
Date:   Wed Apr 15 21:53:37 2020 +0300

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

diff --git a/stem/control.py b/stem/control.py
index c55d7015..5dc53a1a 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -1267,7 +1267,7 @@ class Controller(BaseController):
     return version
 
   @with_default()
-  def get_exit_policy(self, default: Any = UNDEFINED) -> stem.exit_policy.ExitPolicy:
+  async def get_exit_policy(self, default: Any = UNDEFINED) -> stem.exit_policy.ExitPolicy:
     """
     get_exit_policy(default = UNDEFINED)
 
@@ -1293,7 +1293,7 @@ class Controller(BaseController):
     policy = self._get_cache('exit_policy')
 
     if not policy:
-      policy = stem.exit_policy.ExitPolicy(*self.get_info('exit-policy/full').splitlines())
+      policy = stem.exit_policy.ExitPolicy(*(await self.get_info('exit-policy/full')).splitlines())
       self._set_cache({'exit_policy': policy})
 
     return policy



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