~futatuki/mailman/2.1-listinfo-overview-client-lang

« back to all changes in this revision

Viewing changes to Mailman/Queue/BounceRunner.py

  • Committer: Yasuhito FUTATSUKI at POEM
  • Date: 2017-06-06 10:34:51 UTC
  • mfrom: (1654.3.35 2.1)
  • Revision ID: futatuki@poem.co.jp-20170606103451-nmhlvj5u86s9maxw
Merge lp:mailman/2.1 up to rev 1713

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from Mailman import mm_cfg
30
30
from Mailman import Utils
31
31
from Mailman import LockFile
 
32
from Mailman.Errors import NotAMemberError
32
33
from Mailman.Message import UserNotification
33
34
from Mailman.Bouncer import _BounceInfo
34
35
from Mailman.Bouncers import BouncerAPI
151
152
            mlist.Lock()
152
153
        try:
153
154
            op, addr, bmsg = mlist.pend_confirm(token)
154
 
            info = mlist.getBounceInfo(addr)
155
 
            if not info:
156
 
                # info was deleted before probe bounce was received.
157
 
                # Just create a new info.
158
 
                info = _BounceInfo(addr,
159
 
                                   0.0,
160
 
                                   time.localtime()[:3],
161
 
                                   mlist.bounce_you_are_disabled_warnings
162
 
                                   )
163
 
            mlist.disableBouncingMember(addr, info, bmsg)
164
 
            # Only save the list if we're unlocking it
165
 
            if not locked:
166
 
                mlist.Save()
 
155
            # For Python 2.4 compatibility we need an inner try because
 
156
            # try: ... except: ... finally: requires Python 2.5+
 
157
            try:
 
158
                info = mlist.getBounceInfo(addr)
 
159
                if not info:
 
160
                    # info was deleted before probe bounce was received.
 
161
                    # Just create a new info.
 
162
                    info = _BounceInfo(addr,
 
163
                                       0.0,
 
164
                                       time.localtime()[:3],
 
165
                                       mlist.bounce_you_are_disabled_warnings
 
166
                                       )
 
167
                mlist.disableBouncingMember(addr, info, bmsg)
 
168
                # Only save the list if we're unlocking it
 
169
                if not locked:
 
170
                    mlist.Save()
 
171
            except NotAMemberError:
 
172
                # Member was removed before probe bounce returned.
 
173
                # Just ignore it.
 
174
                pass
167
175
        finally:
168
176
            if not locked:
169
177
                mlist.Unlock()