diff options
| author | Barry Warsaw | 2014-11-02 14:55:10 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2014-11-02 14:55:10 -0500 |
| commit | dfc451f81ccc8b0947fb3fa42e94c55026984cf8 (patch) | |
| tree | c9834271a2dc7fd7d998e5dd211a0ef047f8085e /src/mailman/config/config.py | |
| parent | 0b1ee6fc8d224291c68c964a1af6b481921a13b3 (diff) | |
| parent | 1d9f6970b9a26ee576838b53f485b96365e3a6c2 (diff) | |
| download | mailman-dfc451f81ccc8b0947fb3fa42e94c55026984cf8.tar.gz mailman-dfc451f81ccc8b0947fb3fa42e94c55026984cf8.tar.zst mailman-dfc451f81ccc8b0947fb3fa42e94c55026984cf8.zip | |
Diffstat (limited to 'src/mailman/config/config.py')
| -rw-r--r-- | src/mailman/config/config.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mailman/config/config.py b/src/mailman/config/config.py index e8c8ebc8b..649d6c5e1 100644 --- a/src/mailman/config/config.py +++ b/src/mailman/config/config.py @@ -33,7 +33,7 @@ import sys from ConfigParser import SafeConfigParser from flufl.lock import Lock from lazr.config import ConfigSchema, as_boolean -from pkg_resources import resource_filename, resource_stream, resource_string +from pkg_resources import resource_stream, resource_string from string import Template from zope.component import getUtility from zope.event import notify @@ -46,7 +46,7 @@ from mailman.interfaces.configuration import ( ConfigurationUpdatedEvent, IConfiguration, MissingConfigurationFileError) from mailman.interfaces.languages import ILanguageManager from mailman.utilities.filesystem import makedirs -from mailman.utilities.modules import call_name +from mailman.utilities.modules import call_name, expand_path SPACE = ' ' @@ -141,7 +141,7 @@ class Configuration: def _expand_paths(self): """Expand all configuration paths.""" # Set up directories. - bin_dir = os.path.abspath(os.path.dirname(sys.argv[0])) + 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. @@ -304,12 +304,7 @@ def external_configuration(path): :return: A `ConfigParser` instance. """ # Is the context coming from a file system or Python path? - if path.startswith('python:'): - resource_path = path[7:] - package, dot, resource = resource_path.rpartition('.') - cfg_path = resource_filename(package, resource + '.cfg') - else: - cfg_path = path + cfg_path = expand_path(path) parser = SafeConfigParser() files = parser.read(cfg_path) if files != [cfg_path]: |
