From 87873dbf22c55f4e5e2ffe5180c61f10a242b8f5 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 25 Dec 2010 16:55:28 +0000 Subject: [PATCH] Workaround to suppress gtk bogus warning regarding non-string items in sys.argv, error reported upstream as gnome (pygtk) #637877 svn: r16313 --- src/constfunc.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/constfunc.py b/src/constfunc.py index e8b17c7b1..e23a88c6b 100644 --- a/src/constfunc.py +++ b/src/constfunc.py @@ -33,6 +33,7 @@ perform a translation on import, eg gtk. # #------------------------------------------------------------------------ import platform +import sys #------------------------------------------------------------------------- # @@ -100,12 +101,17 @@ def has_display(): Tests to see if Python is currently running with gtk and windowing system is Mac OS-X's "quartz". """ + # FIXME: currently, gtk.init_check() requires all strings + # in argv, and we might have unicode. + temp, sys.argv = sys.argv, sys.argv[:1] try: import gtk except: return False try: gtk.init_check() + sys.argv = temp return True except: + sys.argv = temp return False