? gtk/gtkunixprint.c
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/ChangeLog,v
retrieving revision 1.1506
diff -u -r1.1506 ChangeLog
--- ChangeLog	28 Jun 2006 06:37:08 -0000	1.1506
+++ ChangeLog	28 Jun 2006 13:34:38 -0000
@@ -1,3 +1,8 @@
+2006-06-28  Fernando Herrera  <fherrera@onirica.com>
+
+	* gtk/__init__.py: Catch unhandled exceptions and invoke
+	bug-buddy including the trace.
+
 2006-06-27  John Finlay  <finlay@moeraki.com>
 
 	* atk-types.defs: Update defs for atk-1.8
Index: gtk/__init__.py
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gtk/__init__.py,v
retrieving revision 1.38
diff -u -r1.38 __init__.py
--- gtk/__init__.py	6 May 2006 21:01:30 -0000	1.38
+++ gtk/__init__.py	28 Jun 2006 13:34:38 -0000
@@ -33,9 +33,24 @@
 except ImportError:
     pass
 
+def bug_catcher(exctype, value, tb):
+    import traceback
+    import tempfile
+    if exctype is not KeyboardInterrupt:
+        msg = "".join(traceback.format_exception(exctype, value, tb))
+        fd, name = tempfile.mkstemp()
+        os.write(fd,msg)
+        os.system("bug-buddy --include=%s --appname=%s" % (name, sys.argv[0]))
+        os.unlink(name)
+        print msg
+    raise SystemExit
+
+
 # For broken embedded programs which forgot to call Sys_SetArgv
 if not hasattr(sys, 'argv'):
     sys.argv = []
+
+sys.excepthook = bug_catcher
 
 # load the required modules:
 import gobject as _gobject
