From 4c19a941eb487b257d46439a6a238367b05cf6dc Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Mon, 18 Jul 2011 19:18:00 +0200 Subject: [PATCH] disabled embedded loading in python 3.x --- plugins/python/python_plugin.c | 2 ++ plugins/python/symimporter.c | 5 ++++- plugins/python/uwsgi_python.h | 2 ++ plugins/python24/uwsgiplugin.py | 2 +- plugins/python25/uwsgiplugin.py | 2 +- plugins/python26/uwsgiplugin.py | 2 +- plugins/python27/uwsgiplugin.py | 2 +- 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 27973b7d..135cc949 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -807,7 +807,9 @@ void uwsgi_python_init_apps() { #endif #ifdef __linux__ +#ifndef PYTHREE uwsgi_init_symbol_import(); +#endif #endif if (up.test_module != NULL) { diff --git a/plugins/python/symimporter.c b/plugins/python/symimporter.c index fd487fa8..2970be10 100644 --- a/plugins/python/symimporter.c +++ b/plugins/python/symimporter.c @@ -197,19 +197,22 @@ int uwsgi_init_symbol_import() { if (PyType_Ready(&SymImporter_Type) < 0) { + PyErr_Print(); uwsgi_log("unable to initialize symbols importer module\n"); exit(1); } PyObject *uwsgi_em = PyImport_ImportModule("uwsgi"); if (!uwsgi_em) { + PyErr_Print(); uwsgi_log("unable to get uwsgi module\n"); exit(1); } if (PyModule_AddObject(uwsgi_em, "SymbolsImporter", (PyObject *)&SymImporter_Type) < 0) { - uwsgi_log("unable to initialize symbols importer module\n"); + PyErr_Print(); + uwsgi_log("unable to initialize symbols importer object\n"); exit(1); } diff --git a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h index 4fb862ae..ce6b904e 100644 --- a/plugins/python/uwsgi_python.h +++ b/plugins/python/uwsgi_python.h @@ -233,5 +233,7 @@ int uwsgi_python_profiler_call(PyObject *, PyFrameObject *, int, PyObject *); void uwsgi_python_reset_random_seed(void); #ifdef __linux__ +#ifndef PYTHREE int uwsgi_init_symbol_import(void); #endif +#endif diff --git a/plugins/python24/uwsgiplugin.py b/plugins/python24/uwsgiplugin.py index 4cabddbc..c79e5c54 100644 --- a/plugins/python24/uwsgiplugin.py +++ b/plugins/python24/uwsgiplugin.py @@ -2,7 +2,7 @@ import os,sys NAME='python24' -GCC_LIST = map(lambda x: '../python/' + x, ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'gil', 'uwsgi_pymodule', 'profiler']) +GCC_LIST = map(lambda x: '../python/' + x, ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'gil', 'uwsgi_pymodule', 'profiler', 'symimporter']) CFLAGS = os.popen('python2.4-config --cflags').read().rstrip().split() CFLAGS.append('-Wno-unused-parameter') diff --git a/plugins/python25/uwsgiplugin.py b/plugins/python25/uwsgiplugin.py index 1fcbd2b1..e5facb80 100644 --- a/plugins/python25/uwsgiplugin.py +++ b/plugins/python25/uwsgiplugin.py @@ -2,7 +2,7 @@ import os,sys NAME='python25' -GCC_LIST = map(lambda x: '../python/' + x, ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'gil', 'uwsgi_pymodule', 'profiler']) +GCC_LIST = map(lambda x: '../python/' + x, ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'gil', 'uwsgi_pymodule', 'profiler', 'symimporter']) CFLAGS = os.popen('python2.5-config --cflags').read().rstrip().split() CFLAGS.append('-Wno-unused-parameter') diff --git a/plugins/python26/uwsgiplugin.py b/plugins/python26/uwsgiplugin.py index 26a9276f..8728769d 100644 --- a/plugins/python26/uwsgiplugin.py +++ b/plugins/python26/uwsgiplugin.py @@ -2,7 +2,7 @@ import os,sys NAME='python26' -GCC_LIST = map(lambda x: '../python/' + x, ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'gil', 'uwsgi_pymodule', 'profiler']) +GCC_LIST = map(lambda x: '../python/' + x, ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'gil', 'uwsgi_pymodule', 'profiler', 'symimporter']) CFLAGS = os.popen('python2.6-config --cflags').read().rstrip().split() CFLAGS.append('-Wno-unused-parameter') diff --git a/plugins/python27/uwsgiplugin.py b/plugins/python27/uwsgiplugin.py index ce53d210..bf076cec 100644 --- a/plugins/python27/uwsgiplugin.py +++ b/plugins/python27/uwsgiplugin.py @@ -2,7 +2,7 @@ import os,sys NAME='python27' -GCC_LIST = map(lambda x: '../python/' + x, ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'gil', 'uwsgi_pymodule', 'profiler']) +GCC_LIST = map(lambda x: '../python/' + x, ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'gil', 'uwsgi_pymodule', 'profiler', 'symimporter']) CFLAGS = os.popen('python2.7-config --cflags').read().rstrip().split() CFLAGS.append('-Wno-unused-parameter')