Makes a little more sense there, as it's only meant to handle
exceptions if you're using the command line version.
}
args.update(kwargs)
- try:
- return render(**args)
- except SyntaxError as e:
- print('Chevron: syntax error')
- print(' ' + '\n '.join(e.args[0].split('\n')))
+ return render(**args)
def cli_main():
args = vars(parser.parse_args())
- result = main(**args)
- if result is None:
+ try:
+ print(main(**args))
+ except SyntaxError as e:
+ print('Chevron: syntax error')
+ print(' ' + '\n '.join(e.args[0].split('\n')))
exit(1)
- print(result)
if __name__ == '__main__':
cli_main()