From b3b7010c4e974843ac95467f46d5d63c45e1bb6c Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Mon, 24 Feb 2003 15:37:57 +0000 Subject: __init__(): Don't call out to extend.py if name is None. This will be the case when creating the mailing list, in which case fullpath() will be None so we won't be able to locate the list directory. --- Mailman/MailList.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Mailman/MailList.py b/Mailman/MailList.py index be27f9e28..f5924228d 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -97,7 +97,10 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, self._memberadaptor = OldStyleMemberships(self) # This extension mechanism allows list-specific overrides of any # method (well, except __init__(), InitTempVars(), and InitVars() - # I think). + # I think). Note that fullpath() will return None when we're creating + # the list, which will only happen when name is None. + if name is None: + return filename = os.path.join(self.fullpath(), 'extend.py') dict = {} try: @@ -108,12 +111,11 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, func = dict.get('extend') if func: func(self) - if name: - if lock: - # This will load the database. - self.Lock() - else: - self.Load() + if lock: + # This will load the database. + self.Lock() + else: + self.Load() def __getattr__(self, name): # Because we're using delegation, we want to be sure that attribute -- cgit v1.3.1