summaryrefslogtreecommitdiff
path: root/python/skytools
diff options
context:
space:
mode:
authorMarko Kreen2009-12-03 14:44:02 +0000
committerMarko Kreen2009-12-03 14:44:02 +0000
commit1176503965ff2bd09ae07663e52e38cf6e044edc (patch)
tree3294ff604c12d785bbd330f0aa943b4b8146128c /python/skytools
parentbe73d86f31db7e87975e3878adf2f1e9638c8db1 (diff)
skytools.Config: allow missing filename
Diffstat (limited to 'python/skytools')
-rw-r--r--python/skytools/config.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/skytools/config.py b/python/skytools/config.py
index fd18ef13..43d0a46b 100644
--- a/python/skytools/config.py
+++ b/python/skytools/config.py
@@ -19,7 +19,10 @@ class Config(object):
@param sane_config: chooses between ConfigParser/SafeConfigParser.
"""
# use config file name as default job_name
- job_name = os.path.splitext(os.path.basename(filename))[0]
+ if filename:
+ job_name = os.path.splitext(os.path.basename(filename))[0]
+ else:
+ job_name = main_section
# initialize defaults, make them usable in config file
defs = {