another improvement for sys.executable in python3

This commit is contained in:
roberto@debian32
2011-08-26 10:28:34 +02:00
parent efa01ea404
commit 4104f825ff
+8
View File
@@ -108,7 +108,15 @@ void init_pyargv() {
PySys_SetArgv(up.argc, up.py_argv);
PyObject *sys_dict = get_uwsgi_pydict("sys");
if (!sys_dict) {
uwsgi_log("unable to load python sys module !!!\n");
exit(1);
}
#ifdef PYTHREE
PyDict_SetItemString(sys_dict, "executable", PyUnicode_FromString(uwsgi.binary_path));
#else
PyDict_SetItemString(sys_dict, "executable", PyString_FromString(uwsgi.binary_path));
#endif
}