[pygi] reset sys.argv to the return value of Gtk.init_check



commit d963007aab123f4e53a944a66a935db2d22907c2
Author: John (J5) Palmieri <johnp redhat com>
Date:   Mon May 17 11:54:34 2010 -0400

    reset sys.argv to the return value of Gtk.init_check
    
    * applications which check command line arguments will error out if it
      encounters a GTK command line switch such as --g-fatal-warnings.
    * The Gtk.init* API reads these switches and returns a new argv with the GTK
      switches stripped out
    * In C argv is modified in place but in Python we must set sys.argv to the
      new modified argument list
    * fixes https://bugzilla.gnome.org/show_bug.cgi?id=618889

 gi/overrides/Gtk.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index dd8963c..ebbbfc4 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -230,5 +230,6 @@ __all__ = ['ActionGroup', 'Builder', 'UIManager']
 import sys
 
 initialized, argv = Gtk.init_check(sys.argv)
+sys.argv = argv
 if not initialized:
     raise RuntimeError("Gtk couldn't be initialized")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]