summaryrefslogtreecommitdiff
path: root/src/mailman/config/config.py
diff options
context:
space:
mode:
authorBarry Warsaw2015-11-01 15:44:23 -0500
committerBarry Warsaw2015-11-01 15:52:03 -0500
commit212127e9374ec6791a90306f176d1961b3befc67 (patch)
treee25a719790ff0f99715203c66002c2dfda0b3d39 /src/mailman/config/config.py
parent49fff6df2add54fa2c195ca734b00bfe9f275c5c (diff)
downloadmailman-212127e9374ec6791a90306f176d1961b3befc67.tar.gz
mailman-212127e9374ec6791a90306f176d1961b3befc67.tar.zst
mailman-212127e9374ec6791a90306f176d1961b3befc67.zip
Diffstat (limited to 'src/mailman/config/config.py')
-rw-r--r--src/mailman/config/config.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/mailman/config/config.py b/src/mailman/config/config.py
index e9da7ae4f..9a9f247fd 100644
--- a/src/mailman/config/config.py
+++ b/src/mailman/config/config.py
@@ -134,20 +134,8 @@ class Configuration:
def _expand_paths(self):
"""Expand all configuration paths."""
- # First we need to locate the bin directory. This can differ in
- # several cases, such as, if we're installing into a virtual
- # environment, /usr/bin, /usr/local/bin, or running the test suite.
- # We'll try some common locations, looking for a landmark. First
- # location wins.
- for origin in (sys.executable, sys.argv[0]):
- bin_dir = os.path.abspath(os.path.dirname(origin))
- # Search for 'master' in this directory, since that's the thing we
- # actually need to be able to run.
- if os.path.exists(os.path.join(bin_dir, 'master')):
- break
- else:
- print("Could not find the 'master' script", file=sys.stderr)
- sys.exit(1)
+ # Set up directories.
+ default_bin_dir = os.path.abspath(os.path.dirname(sys.executable))
# Now that we've loaded all the configuration files we're going to
# load, set up some useful directories based on the settings in the
# configuration file.
@@ -168,7 +156,7 @@ class Configuration:
var_dir = os.environ.get('MAILMAN_VAR_DIR', category.var_dir)
substitutions = dict(
cwd = os.getcwd(),
- argv = bin_dir,
+ argv = default_bin_dir,
# Directories.
bin_dir = category.bin_dir,
data_dir = category.data_dir,