PipelineError: fix str() on python2.4 . Closes #842.

This commit is contained in:
Brian Warner 2009-11-24 13:25:12 -08:00
parent d918ab407e
commit 41bcc9f39e
2 changed files with 5 additions and 1 deletions

View 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

View 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."""