bleachbit (0.9.2-2) no_X.patch

Summary

 bleachbit.py |    5 +++++
 1 file changed, 5 insertions(+)

    
download this patch

Patch contents

Description: Do not try to launch GUI if X is not available
Author: Luca Falavigna <dktrkranz@debian.org>
Forwarded: https://launchpad.net/bugs/1004923

Index: bleachbit-0.9.2/bleachbit.py
===================================================================
--- bleachbit-0.9.2.orig/bleachbit.py	2012-03-15 04:24:51.000000000 +0100
+++ bleachbit-0.9.2/bleachbit.py	2012-05-26 18:16:40.679476296 +0200
@@ -39,6 +39,11 @@
 
 if 1 == len(sys.argv):
     import gtk
+    try:
+        gtk.gdk.Screen().get_display()
+    except RuntimeError:
+        print "Could not open X display"
+        sys.exit(1)
     import bleachbit.GUI
     gui = bleachbit.GUI.GUI()
     gtk.main()