diff options
| author | twouters | 2001-07-26 13:31:29 +0000 |
|---|---|---|
| committer | twouters | 2001-07-26 13:31:29 +0000 |
| commit | 29c882c1f252854e5c4b7df57804ec21b00bd218 (patch) | |
| tree | f9c1876a693330901f5bede35895f0e32ff8659c /cron | |
| parent | ea73170cd34502278b06e5dcca5af540d2005be7 (diff) | |
| download | mailman-29c882c1f252854e5c4b7df57804ec21b00bd218.tar.gz mailman-29c882c1f252854e5c4b7df57804ec21b00bd218.tar.zst mailman-29c882c1f252854e5c4b7df57804ec21b00bd218.zip | |
poll_newsgroup(): work around Python 2.0 restriction on continue inside try
clauses.
Diffstat (limited to 'cron')
| -rwxr-xr-x | cron/gate_news | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cron/gate_news b/cron/gate_news index 4cad891fc..fc34e691e 100755 --- a/cron/gate_news +++ b/cron/gate_news @@ -60,6 +60,11 @@ LogStdErr('error', 'gate_news', manual_reprime=0, tee_to_stdout=1) LOCK_LIFETIME = mm_cfg.hours(2) NL = '\n' +# We need this exception to work around the continue-inside-try deficiency +# in Python versions before 2.1. +class _ContinueLoop(Exception): + """Internal exception to continue loops from inside try blocks""" + pass def usage(status, msg=''): @@ -122,7 +127,7 @@ def poll_newsgroup(mlist, conn, first, last, glock): syslog('fromusenet', 'mimelib exception for %s:%d\n%s', mlist.linked_newsgroup, num, e) - continue + raise _ContinueLoop if found_to: del msg['X-Originally'] msg['X-Originally-To'] = msg['To'] @@ -139,6 +144,8 @@ def poll_newsgroup(mlist, conn, first, last, glock): syslog('fromusenet', 'NNTP error for list %s: %7d' % (listname, num)) syslog('fromusenet', str(msg)) + except _ContinueLoop: + continue # Even if we don't post the message because it was seen on the # list already, update the watermark mlist.usenet_watermark = num |
