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

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



commit 7c6ef4e234ec3c1ff40b912d7d8349df4d03f44f
Author: Illia Volochii <illia.volochii@xxxxxxxxx>
Date:   Fri Apr 17 19:53:24 2020 +0300

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

diff --git a/stem/control.py b/stem/control.py
index 4469e9c5..86af0e8a 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -1970,7 +1970,7 @@ class Controller(BaseController):
     return stem.descriptor.router_status_entry.RouterStatusEntryV3(desc_content)
 
   @with_default(yields = True)
-  def get_network_statuses(self, default: Any = UNDEFINED) -> Iterator[stem.descriptor.router_status_entry.RouterStatusEntryV3]:
+  async def get_network_statuses(self, default: Any = UNDEFINED) -> Iterator[stem.descriptor.router_status_entry.RouterStatusEntryV3]:
     """
     get_network_statuses(default = UNDEFINED)
 
@@ -1992,7 +1992,7 @@ class Controller(BaseController):
     #
     # https://trac.torproject.org/8248
 
-    desc_content = self.get_info('ns/all', get_bytes = True)
+    desc_content = await self.get_info('ns/all', get_bytes = True)
 
     if not desc_content:
       raise stem.DescriptorUnavailable('Descriptor information is unavailable, tor might still be downloading it')



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