replace raw string with normal C string to fix build failure

This commit is contained in:
wmayer
2019-05-23 23:28:33 +02:00
parent 6f2a611b66
commit 81ae5688d4

View File

@@ -496,15 +496,16 @@ const char* InterpreterSingleton::init(int argc,char *argv[])
Py_Initialize();
const char* virtualenv = getenv("VIRTUAL_ENV");
if (virtualenv) {
PyRun_SimpleString(R"***(
# Check for virtualenv, and activate if present. See https://virtualenv.pypa.io/en/latest/userguide/#using-virtualenv-without-bin-python
import os
import sys
base_path = os.getenv("VIRTUAL_ENV")
if not base_path is None:
activate_this = os.path.join(base_path, "bin", "activate_this.py")
exec(open(activate_this).read(), {'__file__':activate_this})
)***");
PyRun_SimpleString(
"# Check for virtualenv, and activate if present.\n"
"# See https://virtualenv.pypa.io/en/latest/userguide/#using-virtualenv-without-bin-python\n"
"import os\n"
"import sys\n"
"base_path = os.getenv(\"VIRTUAL_ENV\")\n"
"if not base_path is None:\n"
" activate_this = os.path.join(base_path, \"bin\", \"activate_this.py\")\n"
" exec(open(activate_this).read(), {'__file__':activate_this})\n"
);
}
PyEval_InitThreads();
#if PY_MAJOR_VERSION >= 3