[Skencil-commits] r804 - skencil/branches/skencil-0.6/src/Sketch/Base

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Feb 6 21:46:06 CET 2011


Author: bh
Date: 2011-02-06 21:46:06 +0100 (Sun, 06 Feb 2011)
New Revision: 804

Modified:
   skencil/branches/skencil-0.6/src/Sketch/Base/gtkutils.py
Log:
Use sys.exectuable as the python interpreter in the gtk subprocesses.
This makes the behavior more predictable if multiple python interpreters
are installed on a system, because the interpreter used to run Skencil
is not necessarily the default interpreter.


Modified: skencil/branches/skencil-0.6/src/Sketch/Base/gtkutils.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/Base/gtkutils.py	2011-02-06 20:40:42 UTC (rev 803)
+++ skencil/branches/skencil-0.6/src/Sketch/Base/gtkutils.py	2011-02-06 20:46:06 UTC (rev 804)
@@ -18,6 +18,7 @@
 #License along with this library; if not, write to the Free Software
 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+import sys
 import os, string, copy
 from tempfile import NamedTemporaryFile
 
@@ -44,7 +45,8 @@
         tmpfile = NamedTemporaryFile()
         command = "import gtk;w = gtk.Window();w.realize();"
         command += "style=w.get_style(); print style.font_desc.to_string();"
-        if os.system('python -c "%s" >%s' % (command, tmpfile.name)):
+        if os.system('%s -c "%s" >%s' % (sys.executable, command,
+                                         tmpfile.name)):
             raise Exception
 
         font = tmpfile.readline().strip()
@@ -241,7 +243,8 @@
             " style.bg[gtk.STATE_SELECTED].to_string()," + \
             " style.bg[gtk.STATE_INSENSITIVE].to_string();"
 
-        if os.system('python -c "%s" >%s' % (command, tmpfile.name)):
+        if os.system('%s -c "%s" >%s' % (sys.executable, command,
+                                         tmpfile.name)):
             raise Exception
 
         for type in ["base", "text", "fg", "bg"]:



More information about the Skencil-commits mailing list