mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-10-03 23:48:22 +00:00
fix threading bug in pyshell
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user