Skip to content
Snippets Groups Projects
Commit 03b9e8ec authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

tools: fix handling of config/template errors

This is a follow-up of the Python 3 port.
The `message` field is no longer supported in standard exceptions.
parent 50916857
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,7 @@ def expand_template(template_dict, template_names):
try:
return template_env.select_template(template_names).render(template_dict)
except TemplatesNotFound as error:
feedback.die(error.message)
feedback.die(error)
def expand_template_file(template_dict, template_names, expanded_name,
backup_name, executable):
......@@ -92,7 +92,7 @@ def expand_template_file(template_dict, template_names, expanded_name,
for line in template_env.select_template(template_names).generate(template_dict):
expanded_file.write(line)
except TemplatesNotFound as error:
feedback.die(error.message)
feedback.die(error)
expanded_file.write(u'\n')
expanded_file.close()
if executable:
......@@ -416,7 +416,7 @@ try:
config = ExpConfig(experiment_config_name, extra_dict, config_roots,
getexp=args.getexp)
except ExpConfigError as error:
feedback.die(str(error), status=2)
feedback.die(error, status=2)
# Create target directories
......
......@@ -47,7 +47,7 @@ try:
config_file = sys.stdin
config_data = ConfigObj(config_file, file_error=True)
except IOError as error:
die(error.message)
die(error)
# Walk config to the appropriate section and create output structure
......
......@@ -61,7 +61,7 @@ try:
add_file = sys.stdin
config_data.merge(ConfigObj(add_file, file_error=True))
except IOError as error:
die(error.message)
die(message)
# Remove keys from --delete command line option
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment