1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
* Add try/except at main function of commands.render module.
Index: pystache-0.5.2/pystache/commands/render.py
===================================================================
--- pystache-0.5.2.orig/pystache/commands/render.py 2012-08-13 13:52:49.409755422 +0900
+++ pystache-0.5.2/pystache/commands/render.py 2012-08-13 13:59:52.460436956 +0900
@@ -59,7 +59,14 @@
parser = OptionParser(usage=usage)
options, args = parser.parse_args(args)
- template, context = args
+ try:
+ template, context = args
+ except ValueError as e:
+ print('ERROR: %s' % e)
+ exit(1)
+ except UnboundLocalError as e:
+ print('ERROR: %s' % e)
+ exit(1)
return template, context
|