first round of pypy patches

This commit is contained in:
roberto@mrspurr
2012-03-26 10:46:12 +02:00
parent 282b2d5ace
commit c66957d685
4 changed files with 58 additions and 22 deletions
+8
View File
@@ -8,6 +8,7 @@ int manage_python_response(struct wsgi_request *wsgi_req) {
return uwsgi_response_subhandler_wsgi(wsgi_req);
}
#ifndef UWSGI_PYPY
char *uwsgi_python_get_exception_type(PyObject *exc) {
char *class_name = NULL;
#ifndef PYTHREE
@@ -90,6 +91,7 @@ int uwsgi_python_manage_exceptions(void) {
return ret;
}
#endif
PyObject *python_call(PyObject *callable, PyObject *args, int catch, struct wsgi_request *wsgi_req) {
@@ -103,7 +105,11 @@ PyObject *python_call(PyObject *callable, PyObject *args, int catch, struct wsgi
if (PyErr_Occurred()) {
#ifndef UWSGI_PYPY
int do_exit = uwsgi_python_manage_exceptions();
#else
int do_exit = 0;
#endif
if (PyErr_ExceptionMatches(PyExc_MemoryError)) {
uwsgi_log("Memory Error detected !!!\n");
@@ -222,7 +228,9 @@ void init_pyargv() {
}
#ifndef UWSGI_PYPY
PySys_SetArgv(up.argc, up.py_argv);
#endif
PyObject *sys_dict = get_uwsgi_pydict("sys");
if (!sys_dict) {