Skip to content

Commit 1e59f3e

Browse files
committed
update
1 parent aa999db commit 1e59f3e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Mailman/Queue/IncomingRunner.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,6 @@ def _oneloop(self):
294294
# order. Return an integer count of the number of files that were
295295
# available for this qrunner to process.
296296
try:
297-
# Import MailList here to avoid circular imports
298-
from Mailman.MailList import MailList
299-
300297
# Get the list of files to process
301298
files = self._switchboard.files()
302299
filecnt = len(files)
@@ -320,8 +317,15 @@ def _oneloop(self):
320317
# Get the list name from the message data
321318
listname = msgdata.get('listname', mm_cfg.MAILMAN_SITE_LIST)
322319

323-
# Create a MailList object
320+
# Create a MailList object using lazy import
324321
try:
322+
# Import MailList here to avoid circular imports
323+
from Mailman.MailList import MailList
324+
mlist = MailList(listname, lock=0)
325+
except ImportError:
326+
# If we can't import MailList, try to get it from sys.modules
327+
import sys
328+
MailList = sys.modules['Mailman.MailList'].MailList
325329
mlist = MailList(listname, lock=0)
326330
except Errors.MMUnknownListError:
327331
mailman_log('error', 'IncomingRunner._oneloop: Unknown list %s', listname)

0 commit comments

Comments
 (0)