[Xfce4-commits] <thunarx-python:master> Sanitize the python search path

Adam Plumb noreply at xfce.org
Thu May 27 18:14:02 CEST 2010


Updating branch refs/heads/master
         to dc2c3b577d88646fe17c838d3fdf51c7aeabaa1e (commit)
       from 064b658adbf94ce19bd342159b3b4adb1c2f54d7 (commit)

commit dc2c3b577d88646fe17c838d3fdf51c7aeabaa1e
Author: Adam Plumb <adamplumb at gmail.com>
Date:   Thu Jan 14 08:45:37 2010 -0500

    Sanitize the python search path

 src/thunarx-python.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/thunarx-python.c b/src/thunarx-python.c
index 91856aa..ed524e6 100644
--- a/src/thunarx-python.c
+++ b/src/thunarx-python.c
@@ -129,6 +129,13 @@ thunarx_python_init_python (void)
     return FALSE;
   }
 
+	/* Sanitize sys.path */
+	PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)");
+	if (PyErr_Occurred()) {
+		PyErr_Print();
+		return FALSE;
+	}
+
 	/* pygtk.require("2.0") */
 	debug("pygtk.require(\"2.0\")");
 	pygtk = PyImport_ImportModule("pygtk");



More information about the Xfce4-commits mailing list