fix python3 + virtualenv

This commit is contained in:
roberto@debian32
2011-06-17 16:31:55 +02:00
parent 16eb47070d
commit 14eeae09b1
+3 -2
View File
@@ -89,14 +89,15 @@ int uwsgi_python_init() {
if (up.home != NULL) {
#ifdef PYTHREE
wchar_t *wpyhome;
wpyhome = malloc((sizeof(wchar_t) * strlen(up.home)) + 2);
wpyhome = malloc((sizeof(wchar_t) * strlen(up.home)) + sizeof(wchar_t) );
if (!wpyhome) {
uwsgi_error("malloc()");
exit(1);
}
mbstowcs(wpyhome, up.home, strlen(up.home));
Py_SetPythonHome(wpyhome);
free(wpyhome);
// do not free this memory !!!
//free(wpyhome);
#else
Py_SetPythonHome(up.home);
#endif