# HG changeset patch
# User Jeff Hammel <k0scist@gmail.com>
# Date 1400382647 25200
# Node ID 8b2787e98c01fcb2d6f0d6a2fb5618170db5ea8a
# Parent  ce95c61cb435b745d145ad23bde92d0d47fc4cba
STUB: python/gview.py

diff -r ce95c61cb435 -r 8b2787e98c01 python/gview.py
--- a/python/gview.py	Sat May 17 00:15:45 2014 -0700
+++ b/python/gview.py	Sat May 17 20:10:47 2014 -0700
@@ -50,11 +50,12 @@
     subprocess.check_call(command)
     assert os.path.exists(output)
 
-    if options.viewer:
-        subprocess.call([options.viewer, output])
-
-    if not options.output:
-        os.remove(output)
+    try:
+        if options.viewer:
+            subprocess.call([options.viewer, output])
+    finally:
+        if not options.output:
+            os.remove(output)
 
 
 if __name__ == '__main__':