diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 3458877d..11649c26 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -548,6 +548,9 @@ int uwsgi_python_manage_options(int i, char *optarg) { case 'H': up.home = optarg; return 1; + case 'O': + up.optimize = atoi(optarg); + return 1; case LONG_ARGS_CALLABLE: up.callable = optarg; return 1; diff --git a/plugins/python/pyutils.c b/plugins/python/pyutils.c index 730fb8e8..406d6c24 100644 --- a/plugins/python/pyutils.c +++ b/plugins/python/pyutils.c @@ -55,9 +55,9 @@ void init_pyargv() { #ifdef PYTHREE wchar_t pname[6]; mbstowcs(pname, "uwsgi", 6); - uwsgi.py_argv[0] = pname; + up.py_argv[0] = pname; #else - uwsgi.py_argv[0] = "uwsgi"; + up.py_argv[0] = "uwsgi"; #endif if (up.argv != NULL && !up.argc) { @@ -81,9 +81,9 @@ void init_pyargv() { if (*ap != '\0') { #ifdef PYTHREE mbstowcs( wcargv + strlen(ap), ap, strlen(ap)); - uwsgi.py_argv[up.argc] = wcargv + strlen(ap); + up.py_argv[up.argc] = wcargv + strlen(ap); #else - uwsgi.py_argv[up.argc] = ap; + up.py_argv[up.argc] = ap; #endif up.argc++; } @@ -92,5 +92,5 @@ void init_pyargv() { } } - PySys_SetArgv(up.argc, &up.argv); + PySys_SetArgv(up.argc, up.py_argv); } diff --git a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h index 836c5bc7..2118128b 100644 --- a/plugins/python/uwsgi_python.h +++ b/plugins/python/uwsgi_python.h @@ -56,6 +56,12 @@ struct uwsgi_python { char *argv; int argc; +#ifdef PYTHREE + wchar_t *py_argv[MAX_PYARGV]; +#else + char *py_argv[MAX_PYARGV]; +#endif + PyObject *wsgi_spitout; PyObject *wsgi_writeout; diff --git a/uwsgi.c b/uwsgi.c index fdef4e7d..68357e35 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -1843,9 +1843,6 @@ static int manage_base_opt(int i, char *optarg) { case 'm': uwsgi.shared->options[UWSGI_OPTION_MEMORY_DEBUG] = 1; return 1; - case 'O': - uwsgi.py_optimize = atoi(optarg); - return 1; case 't': uwsgi.shared->options[UWSGI_OPTION_HARAKIRI] = atoi(optarg); return 1; diff --git a/uwsgi.h b/uwsgi.h index 7c25d2f3..81c8bf3d 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -523,7 +523,6 @@ struct wsgi_request { struct uwsgi_server { - char *pyhome; int has_threads; int apps_cnt; @@ -679,13 +678,7 @@ struct uwsgi_server { char *file_config; //char *python_path[MAX_PYTHONPATH]; - int python_path_cnt; - -#ifdef PYTHREE - wchar_t *py_argv[MAX_PYARGV]; -#else - char *py_argv[MAX_PYARGV]; -#endif + //int python_path_cnt; #ifdef UWSGI_ROUTING #ifndef MAX_UWSGI_ROUTES @@ -706,7 +699,6 @@ struct uwsgi_server { #endif int single_interpreter; - int py_optimize; struct uwsgi_shared *shared;