scanner: If GI_SCANNER_DEBUG is set, drop into a debugger on error
authorColin Walters <walters@verbum.org>
Wed, 25 Aug 2010 14:57:17 +0000 (10:57 -0400)
committerColin Walters <walters@verbum.org>
Tue, 31 Aug 2010 20:05:55 +0000 (16:05 -0400)
Useful when debugging build problems for both me, and potentially over
IRC.

tools/g-ir-scanner.in

index d2ef89c..5b8035b 100755 (executable)
 import os
 import sys
 
+if 'GI_SCANNER_DEBUG' in os.environ:
+    def on_exception(type, value, tb):
+        import pdb
+        pdb.pm()
+    sys.excepthook = on_exception
+
 # This only works on unix systems
 currentdir = os.path.dirname(os.path.abspath(sys.argv[0]))
 current_name = os.path.basename(currentdir)