changeset 54:f0592002c61d

* If PYLIB environment variable is present, use that for the file to preload
author cannam
date Fri, 09 Oct 2009 14:07:44 +0000
parents 7e59caea821b
children 968258fba5d6
files vampy-main.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/vampy-main.cpp	Fri Oct 09 13:48:25 2009 +0000
+++ b/vampy-main.cpp	Fri Oct 09 14:07:44 2009 +0000
@@ -247,6 +247,13 @@
 	// this is useful to find out where the loaded library might be loaded from
 	cerr << "Python exec prefix: " << Py_GetExecPrefix() << endl;
 
+    char *pylib = getenv("PYLIB");
+    if (pylib && *pylib) {
+        cerr << "Trying to preload Python from specified location " << pylib
+	    << "..." << endl;
+        return tryPreload(string(pylib));
+    } 
+
     vector<string> pfxs;
     pfxs.push_back(string(Py_GetExecPrefix()) + "/");
     pfxs.push_back(string(Py_GetExecPrefix()) + "/lib/");