diff options
author | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2017-02-15 17:35:23 +0900 |
---|---|---|
committer | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2017-02-15 17:35:23 +0900 |
commit | 593d91698db3fa9dd99b64f2973ee14947dd4782 (patch) | |
tree | 00fa54270be0043ccb74614df7321816c6facc76 /Mailman/Queue | |
parent | ee5b57e4bc8fdca687cbc04a1338941941f29b1d (diff) | |
parent | c78ea26f8f04cd2e3d2cf231736bcc95ec8cccd5 (diff) | |
download | mailman2-593d91698db3fa9dd99b64f2973ee14947dd4782.tar.gz mailman2-593d91698db3fa9dd99b64f2973ee14947dd4782.tar.xz mailman2-593d91698db3fa9dd99b64f2973ee14947dd4782.zip |
Merge lp:mailman/2.1 up to 1691
Diffstat (limited to '')
-rw-r--r-- | Mailman/Queue/BounceRunner.py | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/Mailman/Queue/BounceRunner.py b/Mailman/Queue/BounceRunner.py index 651039d6..2d14f284 100644 --- a/Mailman/Queue/BounceRunner.py +++ b/Mailman/Queue/BounceRunner.py @@ -29,6 +29,7 @@ from email.Utils import parseaddr from Mailman import mm_cfg from Mailman import Utils from Mailman import LockFile +from Mailman.Errors import NotAMemberError from Mailman.Message import UserNotification from Mailman.Bouncer import _BounceInfo from Mailman.Bouncers import BouncerAPI @@ -151,19 +152,26 @@ class BounceMixin: mlist.Lock() try: op, addr, bmsg = mlist.pend_confirm(token) - info = mlist.getBounceInfo(addr) - if not info: - # info was deleted before probe bounce was received. - # Just create a new info. - info = _BounceInfo(addr, - 0.0, - time.localtime()[:3], - mlist.bounce_you_are_disabled_warnings - ) - mlist.disableBouncingMember(addr, info, bmsg) - # Only save the list if we're unlocking it - if not locked: - mlist.Save() + # For Python 2.4 compatibility we need an inner try because + # try: ... except: ... finally: requires Python 2.5+ + try: + info = mlist.getBounceInfo(addr) + if not info: + # info was deleted before probe bounce was received. + # Just create a new info. + info = _BounceInfo(addr, + 0.0, + time.localtime()[:3], + mlist.bounce_you_are_disabled_warnings + ) + mlist.disableBouncingMember(addr, info, bmsg) + # Only save the list if we're unlocking it + if not locked: + mlist.Save() + except NotAMemberError: + # Member was removed before probe bounce returned. + # Just ignore it. + pass finally: if not locked: mlist.Unlock() |