Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 6d8e28e363a097fb9758fe8fff2f78a8 > files > 12

blender-2.49b-10.1.mga1.src.rpm

--- source/blender/python/BPY_interface.c	2008-10-22 09:09:15.000000000 +0200
+++ source/blender/python/BPY_interface.c.oden	2009-03-09 14:40:18.000000000 +0100
@@ -225,6 +225,12 @@ void BPY_start_python( int argc, char **
 	Py_Initialize(  );
 	
 	PySys_SetArgv( argc_copy, argv_copy );
+
+	/* Sanitize sys.path to prevent relative imports loading modules in
+	 * the current working directory
+	 */
+	PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)");
+
 	/* Initialize thread support (also acquires lock) */
 	PyEval_InitThreads();