1
0
Fork 0
forked from github/pelican

settings: Use splitext to remove extensions, not rpartition

This commit is contained in:
W. Trevor King 2013-01-04 15:09:47 -05:00
commit a5c1fdac58

View file

@ -127,7 +127,7 @@ def get_settings_from_module(module=None, default_settings=_DEFAULT_CONFIG):
def get_settings_from_file(path, default_settings=_DEFAULT_CONFIG):
"""Loads settings from a file path, returning a dict."""
name = os.path.basename(path).rpartition('.')[0]
name, ext = os.path.splitext(os.path.basename(path))
module = imp.load_source(name, path)
return get_settings_from_module(module, default_settings=default_settings)