From: Brian Warner Date: Tue, 24 Nov 2009 21:25:12 +0000 (-0800) Subject: PipelineError: fix str() on python2.4 . Closes #842. X-Git-Url: https://git.rkrishnan.org/maximilian?a=commitdiff_plain;h=41bcc9f39ec52c7e5d58f888b7cc822cc6eaf1c8;p=tahoe-lafs%2Ftahoe-lafs.git PipelineError: fix str() on python2.4 . Closes #842. --- diff --git a/src/allmydata/test/test_util.py b/src/allmydata/test/test_util.py index c7cdd04a..1052a05e 100644 --- a/src/allmydata/test/test_util.py +++ b/src/allmydata/test/test_util.py @@ -1426,6 +1426,8 @@ class Pipeline(unittest.TestCase): f = finished[0] self.failUnless(isinstance(f, Failure)) self.failUnless(f.check(pipeline.PipelineError)) + self.failUnlessIn("PipelineError", str(f.value)) + self.failUnlessIn("ValueError", str(f.value)) r = repr(f.value) self.failUnless("ValueError" in r, r) f2 = f.value.error diff --git a/src/allmydata/util/pipeline.py b/src/allmydata/util/pipeline.py index 5f3b031c..b072dc50 100644 --- a/src/allmydata/util/pipeline.py +++ b/src/allmydata/util/pipeline.py @@ -11,7 +11,9 @@ class PipelineError(Exception): self.error = error def __repr__(self): - return "" % self.error + return "" % (self.error,) + def __str__(self): + return "" % (self.error,) class SingleFileError(Exception): """You are not permitted to add a job to a full pipeline."""