summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman/bin/gate_news.py6
-rw-r--r--src/mailman/bin/master.py5
-rw-r--r--src/mailman/bin/senddigests.py2
-rw-r--r--src/mailman/commands/cli_lists.py2
-rw-r--r--src/mailman/core/switchboard.py4
-rw-r--r--src/mailman/handlers/mime_delete.py6
-rw-r--r--src/mailman/rules/administrivia.py2
-rw-r--r--src/mailman/runners/command.py2
8 files changed, 15 insertions, 14 deletions
diff --git a/src/mailman/bin/gate_news.py b/src/mailman/bin/gate_news.py
index b9d76cb38..9bb1e5f61 100644
--- a/src/mailman/bin/gate_news.py
+++ b/src/mailman/bin/gate_news.py
@@ -80,7 +80,7 @@ def open_newsgroup(mlist):
readermode=True,
user=config.NNTP_USERNAME,
password=config.NNTP_PASSWORD)
- except (socket.error, nntplib.NNTPError, IOError), e:
+ except (socket.error, nntplib.NNTPError, IOError) as e:
log.error('error opening connection to nntp_host: %s\n%s',
mlist.nntp_host, e)
raise
@@ -137,7 +137,7 @@ def poll_newsgroup(mlist, conn, first, last, glock):
p = Parser(Message.Message)
try:
msg = p.parsestr(NL.join(lines))
- except email.Errors.MessageError, e:
+ except email.Errors.MessageError as e:
log.error('email package exception for %s:%d\n%s',
mlist.linked_newsgroup, num, e)
raise _ContinueLoop
@@ -152,7 +152,7 @@ def poll_newsgroup(mlist, conn, first, last, glock):
listname=mlist.internal_name(),
fromusenet=True)
log.info('posted to list %s: %7d', listname, num)
- except nntplib.NNTPError, e:
+ except nntplib.NNTPError as e:
log.exception('NNTP error for list %s: %7d', listname, num)
except _ContinueLoop:
continue
diff --git a/src/mailman/bin/master.py b/src/mailman/bin/master.py
index b0cae62ad..fa0ec0f16 100644
--- a/src/mailman/bin/master.py
+++ b/src/mailman/bin/master.py
@@ -372,9 +372,10 @@ class Loop:
# For the testing framework, if this environment variable is set, pass
# it on to the subprocess.
coverage_env = os.environ.get('COVERAGE_PROCESS_START')
+ env = dict()
if coverage_env is not None:
- env = dict(COVERAGE_PROCESS_START=coverage_env)
- args.append(env)
+ env['COVERAGE_PROCESS_START'] = coverage_env
+ args.append(env)
os.execle(*args)
# We should never get here.
raise RuntimeError('os.execle() failed')
diff --git a/src/mailman/bin/senddigests.py b/src/mailman/bin/senddigests.py
index 6ac8af0b7..3fbec6675 100644
--- a/src/mailman/bin/senddigests.py
+++ b/src/mailman/bin/senddigests.py
@@ -68,7 +68,7 @@ def main():
# We are unable to predict what exception may occur in digest
# processing and we don't want to lose the other digests, so
# we catch everything.
- except Exception, errmsg:
+ except Exception as errmsg:
print >> sys.stderr, \
'List: %s: problem processing %s:\n%s' % \
(listname,
diff --git a/src/mailman/commands/cli_lists.py b/src/mailman/commands/cli_lists.py
index 79845ad57..cf1bd2ead 100644
--- a/src/mailman/commands/cli_lists.py
+++ b/src/mailman/commands/cli_lists.py
@@ -208,7 +208,7 @@ class Create:
except ListAlreadyExistsError:
self.parser.error(_('List already exists: $fqdn_listname'))
return
- except BadDomainSpecificationError, domain:
+ except BadDomainSpecificationError as domain:
self.parser.error(_('Undefined domain: $domain'))
return
# Find the language associated with the code, then set the mailing
diff --git a/src/mailman/core/switchboard.py b/src/mailman/core/switchboard.py
index 8a94588fa..2e8ef24a7 100644
--- a/src/mailman/core/switchboard.py
+++ b/src/mailman/core/switchboard.py
@@ -97,7 +97,7 @@ class Switchboard:
self._lower = None
self._upper = None
# BAW: test performance and end-cases of this algorithm
- if numslices <> 1:
+ if numslices != 1:
self._lower = ((shamax + 1) * slice) / numslices
self._upper = (((shamax + 1) * (slice + 1)) / numslices) - 1
if recover:
@@ -201,7 +201,7 @@ class Switchboard:
# By ignoring anything that doesn't end in .pck, we ignore
# tempfiles and avoid a race condition.
filebase, ext = os.path.splitext(f)
- if ext <> extension:
+ if ext != extension:
continue
when, digest = filebase.split('+', 1)
# Throw out any files which don't match our bitrange. BAW: test
diff --git a/src/mailman/handlers/mime_delete.py b/src/mailman/handlers/mime_delete.py
index ff6c19ce2..98c1de3f9 100644
--- a/src/mailman/handlers/mime_delete.py
+++ b/src/mailman/handlers/mime_delete.py
@@ -146,7 +146,7 @@ def process(mlist, msg, msgdata):
reset_payload(msg, firstalt)
# If we removed some parts, make note of this
changedp = 0
- if numparts <> len([subpart for subpart in msg.walk()]):
+ if numparts != len([subpart for subpart in msg.walk()]):
changedp = 1
# Now perhaps convert all text/html to text/plain
if mlist.convert_html_to_plaintext and config.HTML_TO_PLAIN_TEXT_COMMAND:
@@ -256,8 +256,8 @@ def to_plaintext(msg):
finally:
try:
os.unlink(filename)
- except OSError, e:
- if e.errno <> errno.ENOENT:
+ except OSError as e:
+ if e.errno != errno.ENOENT:
raise
# Now replace the payload of the subpart and twiddle the Content-Type:
del subpart['content-transfer-encoding']
diff --git a/src/mailman/rules/administrivia.py b/src/mailman/rules/administrivia.py
index 9d30d8cf0..3052dcb46 100644
--- a/src/mailman/rules/administrivia.py
+++ b/src/mailman/rules/administrivia.py
@@ -69,7 +69,7 @@ class Administrivia:
# First check the Subject text.
lines_to_check = []
subject = str(msg.get('subject', ''))
- if subject <> '':
+ if subject != '':
lines_to_check.append(subject)
# Search only the first text/plain subpart of the message. There's
# really no good way to find email commands in any other content type.
diff --git a/src/mailman/runners/command.py b/src/mailman/runners/command.py
index 027791fbf..3d91f663a 100644
--- a/src/mailman/runners/command.py
+++ b/src/mailman/runners/command.py
@@ -158,7 +158,7 @@ class CommandRunner(Runner):
# the command message.
precedence = msg.get('precedence', '').lower()
ack = msg.get('x-ack', '').lower()
- if ack <> 'yes' and precedence in ('bulk', 'junk', 'list'):
+ if ack != 'yes' and precedence in ('bulk', 'junk', 'list'):
log.info('%s Precedence: %s message discarded by: %s',
message_id, precedence, mlist.request_address)
return False