File: exception_arguments

package info (click to toggle)
pystache 0.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 948 kB
  • sloc: python: 3,021; makefile: 16; sh: 15
file content (21 lines) | stat: -rw-r--r-- 727 bytes parent folder | download | duplicates (7)
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