diff options
author | Petr Viktorin <encukou@gmail.com> | 2021-06-10 15:58:25 +0200 |
---|---|---|
committer | Petr Viktorin <encukou@gmail.com> | 2021-06-10 16:28:43 +0200 |
commit | 8dbf81e0280c902cd6af6b254d233ecead10b56c (patch) | |
tree | 22dbf94f8287b14faa99bca7b4706d37e3d6e238 /src/server | |
parent | a73166e01394bbbbaad7cda18418dd7cb37fd45e (diff) | |
download | mod_wsgi-8dbf81e0280c902cd6af6b254d233ecead10b56c.tar.gz |
Replace undocumented PyEval_CallObject with PyObject_CallObject
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/mod_wsgi.c | 44 | ||||
-rw-r--r-- | src/server/wsgi_interp.c | 24 | ||||
-rw-r--r-- | src/server/wsgi_logger.c | 4 | ||||
-rw-r--r-- | src/server/wsgi_metrics.c | 2 | ||||
-rw-r--r-- | src/server/wsgi_stream.c | 4 |
5 files changed, 36 insertions, 42 deletions
diff --git a/src/server/mod_wsgi.c b/src/server/mod_wsgi.c index 4f1d876..903d857 100644 --- a/src/server/mod_wsgi.c +++ b/src/server/mod_wsgi.c @@ -2897,7 +2897,7 @@ static int Adapter_process_file_wrapper(AdapterObject *self) if (!method) return 0; - object = PyEval_CallObject(method, NULL); + object = PyObject_CallObject(method, NULL); Py_DECREF(method); if (!object) { @@ -3179,7 +3179,7 @@ static int Adapter_run(AdapterObject *self, PyObject *object) args = Py_BuildValue("(OO)", vars, start); - self->sequence = PyEval_CallObject(object, args); + self->sequence = PyObject_CallObject(object, args); if (self->sequence != NULL) { if (!Adapter_process_file_wrapper(self)) { @@ -3301,7 +3301,7 @@ static int Adapter_run(AdapterObject *self, PyObject *object) close = PyObject_GetAttrString(self->sequence, "close"); args = Py_BuildValue("()"); - data = PyEval_CallObject(close, args); + data = PyObject_CallObject(close, args); Py_DECREF(args); Py_XDECREF(data); @@ -3910,7 +3910,7 @@ static int wsgi_reload_required(apr_pool_t *pool, request_rec *r, Py_INCREF(object); args = Py_BuildValue("(s)", resource); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); @@ -4283,7 +4283,7 @@ static int wsgi_execute_script(request_rec *r) } else { args = PyTuple_New(0); - object = PyEval_CallObject(method, args); + object = PyObject_CallObject(method, args); Py_DECREF(args); } @@ -6892,7 +6892,7 @@ static int wsgi_execute_dispatch(request_rec *r) if (adapter) { Py_INCREF(object); args = Py_BuildValue("(O)", vars); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); @@ -6974,7 +6974,7 @@ static int wsgi_execute_dispatch(request_rec *r) if (adapter) { Py_INCREF(object); args = Py_BuildValue("(O)", vars); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); @@ -7056,7 +7056,7 @@ static int wsgi_execute_dispatch(request_rec *r) if (adapter) { Py_INCREF(object); args = Py_BuildValue("(O)", vars); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); @@ -7147,9 +7147,7 @@ static int wsgi_execute_dispatch(request_rec *r) adapter->log->ob_type->tp_name); } else { - args = PyTuple_New(0); - object = PyEval_CallObject(method, args); - Py_DECREF(args); + object = PyObject_CallObject(method, NULL); } Py_XDECREF(object); @@ -14841,7 +14839,7 @@ static authn_status wsgi_check_password(request_rec *r, const char *user, Py_INCREF(object); args = Py_BuildValue("(Oss)", vars, user, password); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); Py_DECREF(vars); @@ -14911,10 +14909,8 @@ static authn_status wsgi_check_password(request_rec *r, const char *user, adapter->log->ob_type->tp_name); } else { - args = PyTuple_New(0); - result = PyEval_CallObject(method, args); + result = PyObject_CallObject(method, NULL); Py_XDECREF(result); - Py_DECREF(args); } /* Log any details of exceptions if execution failed. */ @@ -15086,7 +15082,7 @@ static authn_status wsgi_get_realm_hash(request_rec *r, const char *user, Py_INCREF(object); args = Py_BuildValue("(Oss)", vars, user, realm); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); Py_DECREF(vars); @@ -15158,7 +15154,7 @@ static authn_status wsgi_get_realm_hash(request_rec *r, const char *user, } else { args = PyTuple_New(0); - result = PyEval_CallObject(method, args); + result = PyObject_CallObject(method, args); Py_XDECREF(result); Py_DECREF(args); } @@ -15337,7 +15333,7 @@ static int wsgi_groups_for_user(request_rec *r, WSGIRequestConfig *config, Py_INCREF(object); args = Py_BuildValue("(Os)", vars, r->user); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); Py_DECREF(vars); @@ -15450,7 +15446,7 @@ static int wsgi_groups_for_user(request_rec *r, WSGIRequestConfig *config, } else { args = PyTuple_New(0); - result = PyEval_CallObject(method, args); + result = PyObject_CallObject(method, args); Py_XDECREF(result); Py_DECREF(args); } @@ -15623,7 +15619,7 @@ static int wsgi_allow_access(request_rec *r, WSGIRequestConfig *config, Py_INCREF(object); args = Py_BuildValue("(Oz)", vars, host); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); Py_DECREF(vars); @@ -15675,7 +15671,7 @@ static int wsgi_allow_access(request_rec *r, WSGIRequestConfig *config, } else { args = PyTuple_New(0); - result = PyEval_CallObject(method, args); + result = PyObject_CallObject(method, args); Py_XDECREF(result); Py_DECREF(args); } @@ -15888,7 +15884,7 @@ static int wsgi_hook_check_user_id(request_rec *r) Py_INCREF(object); args = Py_BuildValue("(Oss)", vars, r->user, password); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); Py_DECREF(vars); @@ -15956,10 +15952,8 @@ static int wsgi_hook_check_user_id(request_rec *r) adapter->log->ob_type->tp_name); } else { - args = PyTuple_New(0); - result = PyEval_CallObject(method, args); + result = PyObject_CallObject(method, NULL); Py_XDECREF(result); - Py_DECREF(args); } /* Log any details of exceptions if execution failed. */ diff --git a/src/server/wsgi_interp.c b/src/server/wsgi_interp.c index 5fc38d1..027325f 100644 --- a/src/server/wsgi_interp.c +++ b/src/server/wsgi_interp.c @@ -100,7 +100,7 @@ static PyObject *SignalIntercept_call( Py_INCREF(o); log = newLogObject(NULL, APLOG_WARNING, NULL, 0); args = Py_BuildValue("(OOO)", Py_None, Py_None, log); - result = PyEval_CallObject(o, args); + result = PyObject_CallObject(o, args); Py_XDECREF(result); Py_DECREF(args); Py_DECREF(log); @@ -238,7 +238,7 @@ static PyObject *ShutdownInterpreter_call( PyObject *res = NULL; Py_INCREF(exitfunc); PySys_SetObject("exitfunc", (PyObject *)NULL); - res = PyEval_CallObject(exitfunc, (PyObject *)NULL); + res = PyObject_CallObject(exitfunc, (PyObject *)NULL); if (res == NULL) { PyObject *m = NULL; @@ -290,7 +290,7 @@ static PyObject *ShutdownInterpreter_call( log = newLogObject(NULL, APLOG_ERR, NULL, 0); args = Py_BuildValue("(OOOOO)", type, value, traceback, Py_None, log); - result = PyEval_CallObject(o, args); + result = PyObject_CallObject(o, args); Py_DECREF(args); Py_DECREF(log); Py_DECREF(o); @@ -639,7 +639,7 @@ InterpreterObject *newInterpreterObject(const char *name) callback = PyCFunction_New(&wsgi_system_exit_method[0], NULL); args = Py_BuildValue("(iO)", SIGTERM, callback); - res = PyEval_CallObject(func, args); + res = PyObject_CallObject(func, args); if (!res) { Py_BEGIN_ALLOW_THREADS @@ -984,7 +984,7 @@ InterpreterObject *newInterpreterObject(const char *name) Py_END_ALLOW_THREADS args = Py_BuildValue("(O)", item); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); if (!result) { Py_BEGIN_ALLOW_THREADS @@ -1019,7 +1019,7 @@ InterpreterObject *newInterpreterObject(const char *name) Py_END_ALLOW_THREADS args = Py_BuildValue("(O)", item); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); if (!result) { Py_BEGIN_ALLOW_THREADS @@ -1054,7 +1054,7 @@ InterpreterObject *newInterpreterObject(const char *name) Py_END_ALLOW_THREADS args = Py_BuildValue("(O)", item); - result = PyEval_CallObject(object, args); + result = PyObject_CallObject(object, args); if (!result) { Py_BEGIN_ALLOW_THREADS @@ -1672,7 +1672,7 @@ static void Interpreter_dealloc(InterpreterObject *self) if (func) { PyObject *res = NULL; Py_INCREF(func); - res = PyEval_CallObject(func, (PyObject *)NULL); + res = PyObject_CallObject(func, (PyObject *)NULL); if (!res) { PyErr_Clear(); } @@ -1699,7 +1699,7 @@ static void Interpreter_dealloc(InterpreterObject *self) if (func) { PyObject *res = NULL; Py_INCREF(func); - res = PyEval_CallObject(func, (PyObject *)NULL); + res = PyObject_CallObject(func, (PyObject *)NULL); if (res == NULL) { PyObject *m = NULL; @@ -1742,7 +1742,7 @@ static void Interpreter_dealloc(InterpreterObject *self) log = newLogObject(NULL, APLOG_ERR, NULL, 0); args = Py_BuildValue("(OOOOO)", type, value, traceback, Py_None, log); - result = PyEval_CallObject(o, args); + result = PyObject_CallObject(o, args); Py_DECREF(args); Py_DECREF(log); Py_DECREF(o); @@ -1823,7 +1823,7 @@ static void Interpreter_dealloc(InterpreterObject *self) PyObject *res = NULL; Py_INCREF(exitfunc); PySys_SetObject("exitfunc", (PyObject *)NULL); - res = PyEval_CallObject(exitfunc, (PyObject *)NULL); + res = PyObject_CallObject(exitfunc, (PyObject *)NULL); if (res == NULL) { PyObject *m = NULL; @@ -1875,7 +1875,7 @@ static void Interpreter_dealloc(InterpreterObject *self) log = newLogObject(NULL, APLOG_ERR, NULL, 0); args = Py_BuildValue("(OOOOO)", type, value, traceback, Py_None, log); - result = PyEval_CallObject(o, args); + result = PyObject_CallObject(o, args); Py_DECREF(args); Py_DECREF(log); Py_DECREF(o); diff --git a/src/server/wsgi_logger.c b/src/server/wsgi_logger.c index f47a720..c7470a5 100644 --- a/src/server/wsgi_logger.c +++ b/src/server/wsgi_logger.c @@ -96,7 +96,7 @@ PyObject *newLogWrapperObject(PyObject *buffer) args = Py_BuildValue("(OssOOO)", buffer, "utf-8", "replace", Py_None, Py_True, Py_True); - wrapper = PyEval_CallObject(object, args); + wrapper = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); @@ -662,7 +662,7 @@ void wsgi_log_python_error(request_rec *r, PyObject *log, Py_INCREF(o); args = Py_BuildValue("(OOOOO)", type, value, traceback, Py_None, log); - result = PyEval_CallObject(o, args); + result = PyObject_CallObject(o, args); Py_DECREF(args); Py_DECREF(o); } diff --git a/src/server/wsgi_metrics.c b/src/server/wsgi_metrics.c index 29ee7e6..7b62859 100644 --- a/src/server/wsgi_metrics.c +++ b/src/server/wsgi_metrics.c @@ -1269,7 +1269,7 @@ void wsgi_call_callbacks(const char *name, PyObject *callbacks, log = newLogObject(NULL, APLOG_ERR, NULL, 0); args = Py_BuildValue("(OOOOO)", type, value, traceback, Py_None, log); - result = PyEval_CallObject(o, args); + result = PyObject_CallObject(o, args); Py_DECREF(args); Py_DECREF(log); Py_DECREF(o); diff --git a/src/server/wsgi_stream.c b/src/server/wsgi_stream.c index e40c804..39d5842 100644 --- a/src/server/wsgi_stream.c +++ b/src/server/wsgi_stream.c @@ -124,7 +124,7 @@ static PyObject *Stream_iternext(StreamObject *self) } args = Py_BuildValue("(O)", attribute); - result = PyEval_CallObject(method, args); + result = PyObject_CallObject(method, args); Py_DECREF(args); Py_DECREF(method); @@ -164,7 +164,7 @@ static PyObject *Stream_close(StreamObject *self, PyObject *args) method = PyObject_GetAttrString(self->filelike, "close"); if (method) { - result = PyEval_CallObject(method, (PyObject *)NULL); + result = PyObject_CallObject(method, (PyObject *)NULL); if (!result) PyErr_Clear(); Py_DECREF(method); |