improved the pyshell

This commit is contained in:
roberto@debian32
2011-08-04 07:05:39 +02:00
parent 4f94ceed5e
commit 5353eba35b
6 changed files with 21 additions and 15 deletions
+1 -1
View File
@@ -300,7 +300,7 @@ int uwsgi_response_subhandler_pump(struct wsgi_request *wsgi_req) {
}
wsgi_req->socket->proto_write(wsgi_req, "\r\n", 2);
Py_INCREF(wsgi_req->async_placeholder);
Py_INCREF((PyObject *)wsgi_req->async_placeholder);
if (PyString_Check((PyObject *)wsgi_req->async_placeholder)) {
if ((wsize = wsgi_req->socket->proto_write(wsgi_req, PyString_AsString(wsgi_req->async_placeholder), PyString_Size(wsgi_req->async_placeholder))) < 0) {
+2 -1
View File
@@ -1226,7 +1226,8 @@ void uwsgi_python_fixup() {
}
void uwsgi_python_hijack(void) {
if (up.pyshell) {
// the pyshell will be execute only in the first worker
if (up.pyshell && uwsgi.mywid == 1) {
PyImport_ImportModule("readline");
PyRun_InteractiveLoop(stdin, "uwsgi");
exit(0);
+1 -1
View File
@@ -149,7 +149,7 @@ int uwsgi_response_subhandler_web3(struct wsgi_request *wsgi_req) {
wsgi_req->async_placeholder = PyTuple_GetItem((PyObject *)wsgi_req->async_result, 0);
Py_INCREF(wsgi_req->async_placeholder);
Py_INCREF((PyObject *)wsgi_req->async_placeholder);
PyObject *spit_args = PyTuple_New(2);