diff options
| author | Barry Warsaw | 2012-10-31 17:31:12 +0100 |
|---|---|---|
| committer | Barry Warsaw | 2012-10-31 17:31:12 +0100 |
| commit | a9464c14fc6dfc23613a1ec89446393fe6476f88 (patch) | |
| tree | 74a926cfe64066ebffcf9adb89e7672289173d84 /src/mailman/core | |
| parent | a1666479d87e26e5c79dd1cf507b8ef0472c59aa (diff) | |
| download | mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.gz mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.zst mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.zip | |
* Python 2.7 is not required. Python 2.6 is no longer officially supported.
The code base is now also `python2.7 -3` clean, although there are still
some warnings in 3rd party dependencies. LP: #1073506
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') |
