summaryrefslogtreecommitdiff
path: root/src/mailman/queue
diff options
context:
space:
mode:
authorBarry Warsaw2009-05-16 11:08:46 -0400
committerBarry Warsaw2009-05-16 11:08:46 -0400
commit7e23b2f358806cb14b92dc7833ce773738534d41 (patch)
tree5499b536a163ebb4dedab62f4f7a97b460cece18 /src/mailman/queue
parentad07de3dcdbf0ef11b5b324b9521b748da207fc7 (diff)
downloadmailman-7e23b2f358806cb14b92dc7833ce773738534d41.tar.gz
mailman-7e23b2f358806cb14b92dc7833ce773738534d41.tar.zst
mailman-7e23b2f358806cb14b92dc7833ce773738534d41.zip
Refactor __import__'s into a separate utility module.
Diffstat (limited to 'src/mailman/queue')
-rw-r--r--src/mailman/queue/lmtp.py2
-rw-r--r--src/mailman/queue/outgoing.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mailman/queue/lmtp.py b/src/mailman/queue/lmtp.py
index 68a86eeb3..00c9ad988 100644
--- a/src/mailman/queue/lmtp.py
+++ b/src/mailman/queue/lmtp.py
@@ -119,9 +119,9 @@ class LMTPRunner(Runner, smtpd.SMTPServer):
def __init__(self, slice=None, numslices=1):
localaddr = config.mta.lmtp_host, int(config.mta.lmtp_port)
# Do not call Runner's constructor because there's no QDIR to create
- smtpd.SMTPServer.__init__(self, localaddr, remoteaddr=None)
qlog.debug('LMTP server listening on %s:%s',
localaddr[0], localaddr[1])
+ smtpd.SMTPServer.__init__(self, localaddr, remoteaddr=None)
def handle_accept(self):
conn, addr = self.accept()
diff --git a/src/mailman/queue/outgoing.py b/src/mailman/queue/outgoing.py
index 2093534b4..e64e8c57b 100644
--- a/src/mailman/queue/outgoing.py
+++ b/src/mailman/queue/outgoing.py
@@ -29,6 +29,8 @@ from mailman.config import config
from mailman.core import errors
from mailman.queue import Runner
from mailman.queue.bounce import BounceMixin
+from mailman.utilities.modules import find_name
+
# This controls how often _do_periodic() will try to deal with deferred
# permanent failures. It is a count of calls to _do_periodic()
@@ -45,9 +47,7 @@ class OutgoingRunner(Runner, BounceMixin):
Runner.__init__(self, slice, numslices)
BounceMixin.__init__(self)
# We look this function up only at startup time.
- package, dot, callable_name = config.mta.outgoing.rpartition('.')
- __import__(package)
- self._func = getattr(sys.modules[package], callable_name)
+ self._func = find_name(config.mta.outgoing)
# This prevents smtp server connection problems from filling up the
# error log. It gets reset if the message was successfully sent, and
# set if there was a socket.error.