From: Brian Warner Date: Wed, 10 Jan 2007 04:13:05 +0000 (-0700) Subject: sendOnly: oops, I keep forgetting that you can't really use f.trap in a lambda, becau... X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~378 X-Git-Url: https://git.rkrishnan.org/(%5B%5E?a=commitdiff_plain;h=a65608fec191c8d20c944c3a374b6894ba3fe7c8;p=tahoe-lafs%2Ftahoe-lafs.git sendOnly: oops, I keep forgetting that you can't really use f.trap in a lambda, because it returns the failure it trapped --- diff --git a/src/allmydata/queen.py b/src/allmydata/queen.py index 8e6885b2..cb459612 100644 --- a/src/allmydata/queen.py +++ b/src/allmydata/queen.py @@ -14,7 +14,9 @@ from allmydata.filetable import GlobalVirtualDrive def sendOnly(call, methname, *args, **kwargs): d = call(methname, *args, **kwargs) - d.addErrback(lambda f: f.trap((ConnectionLost, ConnectionDone))) + def _trap(f): + f.trap(ConnectionLost, ConnectionDone) + d.addErrback(_trap) class Roster(service.MultiService, Referenceable): implements(RIQueenRoster)