diff --git a/backend/globaleaks/services/tor.py b/backend/globaleaks/services/tor.py index eec28c4787..c2be3d2554 100644 --- a/backend/globaleaks/services/tor.py +++ b/backend/globaleaks/services/tor.py @@ -5,7 +5,7 @@ from txtorcon import build_local_tor_connection from twisted.internet import reactor -from twisted.internet.defer import Deferred, returnValue +from twisted.internet.defer import Deferred from txtorcon import TorConfig from globaleaks.services.service import Service @@ -34,7 +34,7 @@ def reset(self): self.tor_conn = None def stop(self): - super(Tor, self).stop() + super().stop() if self.tor_conn is None: return @@ -90,10 +90,10 @@ def unload_onion_service(self, tid): return if hasattr(self.state.tenants[tid], 'ephs') and self.state.tenants[tid].ephs: - try: - self.state.tenants[tid].ephs.remove() - except AttributeError: - yield self.state.tenants[tid].ephs.remove_from_tor(self.tor_conn.protocol) + try: + self.state.tenants[tid].ephs.remove() + except AttributeError: + yield self.state.tenants[tid].ephs.remove_from_tor(self.tor_conn.protocol) def operation(self): restart_deferred = Deferred()