From 41bcc9f39ec52c7e5d58f888b7cc822cc6eaf1c8 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 24 Nov 2009 13:25:12 -0800 Subject: [PATCH] PipelineError: fix str() on python2.4 . Closes #842. --- src/allmydata/test/test_util.py | 2 ++ src/allmydata/util/pipeline.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) 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.""" -- 2.45.2