summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
Diffstat (limited to 'source3/python')
-rwxr-xr-xsource3/python/gtdbtool12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/python/gtdbtool b/source3/python/gtdbtool
index 6513366790..792cdeecc0 100755
--- a/source3/python/gtdbtool
+++ b/source3/python/gtdbtool
@@ -244,7 +244,11 @@ if len(sys.argv) != 2:
print "Usage: gdbtool <tdbfile>"
sys.exit(1)
-t = tdb.open(sys.argv[1])
+try:
+ t = tdb.open(sys.argv[1])
+except tdb.error, t:
+ print "gtdbtool: error opening %s: %s" % (sys.argv[1], t)
+ sys.exit(1)
# Create user interface
@@ -269,4 +273,10 @@ w.register_display_value_fn("PRINTERS/", convert_to_hex)
w.build_ui("gtdbtool: %s" % sys.argv[1])
+# Override Python's handling of ctrl-c so we can break out of the gui
+# from the command line.
+
+import signal
+signal.signal(signal.SIGINT, signal.SIG_DFL)
+
mainloop()