mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-23 19:19:31 +01:00
conf: use splitext() to fetch the config name
This fixes incorrect behaviour when there are multiple .'s in the config filename (e.g. '1.2.3.yml' got truncated to confname='1')
This commit is contained in:
parent
1f270c985f
commit
0eb605219b
2
conf.py
2
conf.py
@ -115,7 +115,7 @@ def loadConf(filename, errors_fatal=True, logger=None):
|
||||
# Note: store globally the last loaded conf filename, for REHASH in coremods/control.
|
||||
fname = filename
|
||||
# For the internal config name, strip off any .yml extensions and absolute paths
|
||||
confname = os.path.basename(filename).split('.', 1)[0]
|
||||
confname = os.path.splitext(os.path.basename(filename))[0]
|
||||
try:
|
||||
with open(filename, 'r') as f:
|
||||
conf = yaml.load(f)
|
||||
|
Loading…
Reference in New Issue
Block a user