[tor-commits] [ooni-probe/master] add errback after the callback

art at torproject.org art at torproject.org
Fri Sep 22 18:41:07 UTC 2017


commit c491f79f03e24d118fcbbde0a003584002a054a2
Author: meejah <meejah at meejah.ca>
Date:   Wed Apr 26 14:17:49 2017 -0600

    add errback after the callback
    
    this is a bit subtle, but if any error happens in _setup_complete
    itself, the errback only sees it if it is added *after* the callback
---
 ooni/utils/onion.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ooni/utils/onion.py b/ooni/utils/onion.py
index 9d41b29a..691eda05 100644
--- a/ooni/utils/onion.py
+++ b/ooni/utils/onion.py
@@ -378,8 +378,8 @@ class TorLauncherWithRetries(object):
         log.debug("Building a TorState")
         config.tor.protocol = proto
         state = TorState(proto.tor_protocol)
-        state.post_bootstrap.addCallbacks(self._state_complete,
-                                          self._setup_failed)
+        state.post_bootstrap.addCallback(self._state_complete)
+        state.post_bootstrap.addErrback(self._setup_failed)
 
     def _launch_tor(self):
         return launch_tor(self.tor_config, reactor,





More information about the tor-commits mailing list