PipelineError: fix str() on python2.4 . Closes #842.
authorBrian Warner <warner@lothar.com>
Tue, 24 Nov 2009 21:25:12 +0000 (13:25 -0800)
committerBrian Warner <warner@lothar.com>
Tue, 24 Nov 2009 21:25:12 +0000 (13:25 -0800)
src/allmydata/test/test_util.py
src/allmydata/util/pipeline.py

index c7cdd04af10a79caa5a41afc1732300c32256242..1052a05e5402a4d4175cf94f0b29a484ed666d68 100644 (file)
@@ -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
index 5f3b031c4a54e62bdb6e83febfa16da1eb984200..b072dc502d4e781cb608b7029a4a64053910654a 100644 (file)
@@ -11,7 +11,9 @@ class PipelineError(Exception):
         self.error = error
 
     def __repr__(self):
-        return "<PipelineError error=(%r)>" % self.error
+        return "<PipelineError error=(%r)>" % (self.error,)
+    def __str__(self):
+        return "<PipelineError error=(%s)>" % (self.error,)
 
 class SingleFileError(Exception):
     """You are not permitted to add a job to a full pipeline."""