fix threading bug in pyshell

This commit is contained in:
roberto@debian32
2011-08-16 07:31:20 +02:00
parent c9e759bc14
commit 6f5b468b11
3 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -513,7 +513,7 @@ PyObject *uwsgi_file_loader(void *arg1) {
char *callable = up.callable;
if (!callable) callable = "application";
wsgi_file_module = uwsgi_pyimport_by_filename("uwsgi_wsgi_file", filename);
wsgi_file_module = uwsgi_pyimport_by_filename(uwsgi_pythonize(filename), filename);
if (!wsgi_file_module) {
PyErr_Print();
exit(1);
+2
View File
@@ -1317,6 +1317,8 @@ void uwsgi_python_fixup() {
void uwsgi_python_hijack(void) {
// the pyshell will be execute only in the first worker
UWSGI_GET_GIL;
if (up.pyshell && uwsgi.mywid == 1) {
PyImport_ImportModule("readline");
PyRun_InteractiveLoop(stdin, "uwsgi");
+2
View File
@@ -261,6 +261,8 @@ int uwsgi_python_profiler_call(PyObject *, PyFrameObject *, int, PyObject *);
void uwsgi_python_reset_random_seed(void);
char *uwsgi_pythonize(char *);
#ifdef __linux__
#ifndef PYTHREE
int uwsgi_init_symbol_import(void);