diff options
| author | bwarsaw | 2002-02-12 04:42:07 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-02-12 04:42:07 +0000 |
| commit | 04092ba16b15fa1d0f03299e3029c6f50a2ea54d (patch) | |
| tree | 344a9e975d7b9629d9be775a35baf6dff384783f /misc/paths.py.in | |
| parent | 8e17281d876a975a372feff8e1107e9170e34898 (diff) | |
| download | mailman-04092ba16b15fa1d0f03299e3029c6f50a2ea54d.tar.gz mailman-04092ba16b15fa1d0f03299e3029c6f50a2ea54d.tar.zst mailman-04092ba16b15fa1d0f03299e3029c6f50a2ea54d.zip | |
Move the path hacking addition of the site-packages directory to here
from Defaults.py.in. The problem is that even for Python 2.2, we need
site-packages to appear /before/ the standard library so that we can
pick up the newer version of the email package. Defaults.py/mm_cfg.py
is usually imported too late in the game to work, but paths.py is
about right (although we'll have to audit the command line scripts to
make sure they import paths.py before they import email.*).
Diffstat (limited to '')
| -rw-r--r-- | misc/paths.py.in | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/misc/paths.py.in b/misc/paths.py.in index 7b98b50ba..f774558d1 100644 --- a/misc/paths.py.in +++ b/misc/paths.py.in @@ -1,6 +1,6 @@ # -*- python -*- -# Copyright (C) 1998,1999,2000,2001 by the Free Software Foundation, Inc. +# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -23,6 +23,9 @@ # attributes that other modules may use to get the absolute path to the # installed Mailman distribution. +import sys +import os + # some scripts expect this attribute to be in this module prefix = '@prefix@' exec_prefix = '@exec_prefix@' @@ -33,5 +36,13 @@ if exec_prefix == '${prefix}': # Hack the path to include the parent directory of the $prefix/Mailman package # directory. -import sys sys.path.insert(0, prefix) + +# Include Python's site-packages directory. We need this even for Python 2.2 +# since the email package has some patches not included in 2.2 final (though +# likely included in a 2.2 patch release, not available as of this writing +# 29-Jan-2002). That's why we prepend sitedir to sys.path, not append it. +import sys +sitedir = os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3], + 'site-packages') +sys.path.insert(0, sitedir) |
