[pygobject/wip/msvc-3-24: 4/5] gtk-demo.py: Allow running on Windows/x64



commit c7a8d32b99e0ac3ff5a21da1cb8c03e3a8fb9d43
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Nov 29 14:10:17 2016 +0800

    gtk-demo.py: Allow running on Windows/x64
    
    Windows/x64 does not have g_file_test(), but only has g_file_test_utf8(),
    so define it as so on Windows.  Perhaps we should change GLib to do
    g_file_test() for all cases on Windows, and call g_file_test_utf8 from the
    original locale function, for ABI compatibility.

 demos/gtk-demo/gtk-demo.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/demos/gtk-demo/gtk-demo.py b/demos/gtk-demo/gtk-demo.py
index e7bc360..aa6f185 100755
--- a/demos/gtk-demo/gtk-demo.py
+++ b/demos/gtk-demo/gtk-demo.py
@@ -27,6 +27,9 @@ import textwrap
 
 from gi.repository import GLib, GObject, Pango, GdkPixbuf, Gtk, Gio
 
+if os.name == 'nt':
+    GLib.file_test = GLib.file_test_utf8
+
 try:
     from gi.repository import GtkSource
     GtkSource  # PyFlakes


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