Skip to content

Commit 9929ec8

Browse files
committed
Simplify callback chain on RPCs
1 parent 3831525 commit 9929ec8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

scripts/travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ sudo apt-get install -y debhelper devscripts dh-apparmor dh-python python python
99
pip install coverage coveralls
1010

1111
coverage run setup.py test # tests still to be implemented
12-
coveralls
12+
coveralls || true
1313

1414
./scripts/build.sh -d trusty -t $TRAVIS_COMMIT -n

tor2web/t2w.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,18 @@ def remote_shutdown(self):
169169
reactor.stop()
170170

171171

172-
@defer.inlineCallbacks
173172
def rpc(f, *args, **kwargs):
174173
d = rpc_factory.getRootObject()
175174
d.addCallback(lambda obj: obj.callRemote(f, *args, **kwargs))
176-
ret = yield d
177-
defer.returnValue(ret)
175+
return d
178176

179177

180178
def rpc_log(msg):
181-
rpc("log_debug", str(msg))
179+
return rpc("log_debug", str(msg))
182180

183181

184182
def rpc_shutdown():
185-
rpc("shutdown")
183+
return rpc("shutdown")
186184

187185

188186
class T2WPP(protocol.ProcessProtocol):

0 commit comments

Comments
 (0)