From ab462479e5ebc0d668ab7ad2cc5ccff52a749787 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Sat, 23 Feb 2002 06:34:14 +0000 Subject: Update imports for the new rules on shadowing standard library modules. Specifically, import the email package /after/ we've imported paths. Also, in add_members: change the import of StringIO to use the Python standard cStringIO module, which we can now pretty much guarantee to be there. --- bin/add_members | 5 +++-- bin/dumpdb | 9 ++++----- bin/sync_members | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/add_members b/bin/add_members index ee5c23dbd..3122febfe 100755 --- a/bin/add_members +++ b/bin/add_members @@ -71,16 +71,17 @@ files can be `-'. import sys import os import getopt +from cStringIO import StringIO +import paths +# Import this /after/ paths so that the sys.path is properly hacked from email.Utils import parseaddr -import paths from Mailman import MailList from Mailman import Utils from Mailman import Message from Mailman import Errors from Mailman import mm_cfg -from Mailman.pythonlib.StringIO import StringIO from Mailman import i18n _ = i18n._ diff --git a/bin/dumpdb b/bin/dumpdb index 577d94876..3f9345068 100644 --- a/bin/dumpdb +++ b/bin/dumpdb @@ -36,7 +36,7 @@ Options: If the filename ends with `.db', then it is assumed that the file contains a Python marshal. If the file ends with `.pck' then it is assumed to contain a Python pickle. In either case, if you want to override the default assumption -\(or if the file ends in neither suffix), use the -p or -m flags. +-- or if the file ends in neither suffix -- use the -p or -m flags. """ import sys @@ -45,14 +45,13 @@ import getopt import pprint import cPickle -# BAW: Import order dependency! paths must be imported before anything from -# the email package. import paths +# Import this /after/ paths so that the sys.path is properly hacked +from email.Generator import Generator + from Mailman.Queue.Switchboard import DumperSwitchboard from Mailman.i18n import _ -from email.Generator import Generator - PROGRAM = sys.argv[0] COMMASPACE = ', ' diff --git a/bin/sync_members b/bin/sync_members index fa7410ee1..0e27c8e6a 100755 --- a/bin/sync_members +++ b/bin/sync_members @@ -70,9 +70,11 @@ Where `options' are: """ import sys -import email.Utils import paths +# Import this /after/ paths so that the sys.path is properly hacked +import email.Utils + from Mailman import MailList from Mailman import Errors from Mailman import Utils -- cgit v1.3.1