about summary refs log tree commit diff stats
path: root/src/plugins
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-04-12 22:53:17 +0100
committerJames Booth <boothj5@gmail.com>2016-04-12 22:53:17 +0100
commit1a73aa39cbd7462ed098952d7d78d5f63c9e92d2 (patch)
tree4bbffa18cd80aaada3dd308ace83718a3e7a677b /src/plugins
parenteeb0f71cbf365dfee627a03766a62fb99e02b97e (diff)
parent8ff9fd709114c7e24f1c3a4019fc3afd1e3809ec (diff)
downloadprofani-tty-1a73aa39cbd7462ed098952d7d78d5f63c9e92d2.tar.gz
Merge remote-tracking branch 'origin/python-path'
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/python_plugins.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/plugins/python_plugins.c b/src/plugins/python_plugins.c
index a73cc15b..be32983e 100644
--- a/src/plugins/python_plugins.c
+++ b/src/plugins/python_plugins.c
@@ -62,27 +62,17 @@ python_env_init(void)
     Py_Initialize();
     PyEval_InitThreads();
     python_api_init();
-    GString *path = g_string_new(Py_GetPath());
 
-    g_string_append(path, ":");
+    GString *path = g_string_new("import sys\n");
+    g_string_append(path, "sys.path.append(\"");
     gchar *plugins_dir = plugins_get_dir();
     g_string_append(path, plugins_dir);
-    g_string_append(path, "/");
     g_free(plugins_dir);
+    g_string_append(path, "/\")\n");
 
-    PySys_SetPath(path->str);
-    g_string_free(path, TRUE);
-
-    // add site packages paths
-    PyRun_SimpleString(
-        "import site\n"
-        "import sys\n"
-        "from distutils.sysconfig import get_python_lib\n"
-        "sys.path.append(get_python_lib())\n"
-        "for dir in site.getsitepackages():\n"
-        "   sys.path.append(dir)\n"
-    );
+    PyRun_SimpleString(path->str);
 
+    g_string_free(path, TRUE);
     allow_python_threads();
 }