[nautilus-python/0.5: 11/11] Backport from 0.6, Sanitize the python sys.path
- From: Adam Plumb <adamplumb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-python/0.5: 11/11] Backport from 0.6, Sanitize the python sys.path
- Date: Fri, 26 Feb 2010 21:39:46 +0000 (UTC)
commit 5d6eb7cb1cd31698a7d10c0f632ca967bc9bad2f
Author: Adam Plumb <adamplumb gmail com>
Date: Fri Feb 26 16:38:30 2010 -0500
Backport from 0.6, Sanitize the python sys.path
src/nautilus-python.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-python.c b/src/nautilus-python.c
index 58b3d51..f752697 100644
--- a/src/nautilus-python.c
+++ b/src/nautilus-python.c
@@ -223,6 +223,13 @@ nautilus_python_init_python (void)
PyErr_Print();
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\")");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]