diff options
Diffstat (limited to 'src/mailman/core')
| -rw-r--r-- | src/mailman/core/errors.py | 6 | ||||
| -rw-r--r-- | src/mailman/core/logging.py | 4 | ||||
| -rw-r--r-- | src/mailman/core/tests/test_runner.py | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/mailman/core/errors.py b/src/mailman/core/errors.py index 95a318ca6..42b536d46 100644 --- a/src/mailman/core/errors.py +++ b/src/mailman/core/errors.py @@ -90,6 +90,12 @@ def _(s): class HandlerError(MailmanError): """Base class for all handler errors.""" + def __init__(self, message=None): + self.message = message + + def __str__(self): + return self.message + class HoldMessage(HandlerError): """Base class for all message-being-held short circuits.""" diff --git a/src/mailman/core/logging.py b/src/mailman/core/logging.py index af04b58d1..2442d4913 100644 --- a/src/mailman/core/logging.py +++ b/src/mailman/core/logging.py @@ -40,8 +40,8 @@ _handlers = {} -# XXX I would love to simplify things and use Python 2.6's WatchedFileHandler, -# but there are two problems. First, it's more difficult to handle the test +# XXX I would love to simplify things and use Python's WatchedFileHandler, but +# there are two problems. First, it's more difficult to handle the test # suite's need to reopen the file handler to a different path. Does # zope.testing's logger support fix this? # diff --git a/src/mailman/core/tests/test_runner.py b/src/mailman/core/tests/test_runner.py index ad2548adc..80a503f5d 100644 --- a/src/mailman/core/tests/test_runner.py +++ b/src/mailman/core/tests/test_runner.py @@ -81,7 +81,7 @@ Message-ID: <ant> self.assertEqual(event.message['message-id'], '<ant>') self.assertEqual(event.metadata['listname'], 'test@example.com') self.assertTrue(isinstance(event.error, RuntimeError)) - self.assertEqual(event.error.message, 'borked') + self.assertEqual(str(event.error), 'borked') self.assertTrue(isinstance(event.runner, CrashingRunner)) # The message should also have ended up in the shunt queue. shunted = get_queue_messages('shunt') |
