From c22bfaae83ab5436d008ac0d13e7b47cbe776f08 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 12 Feb 2017 19:27:05 +0100 Subject: bpo-29524: Add Objects/call.c file (#12) * Move all functions to call objects in a new Objects/call.c file. * Rename fast_function() to _PyFunction_FastCallKeywords(). * Copy null_error() from Objects/abstract.c * Inline type_error() in call.c to not have to copy it, it was only called once. * Export _PyEval_EvalCodeWithName() since it is now called from call.c. --- Python/modsupport.c | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'Python/modsupport.c') diff --git a/Python/modsupport.c b/Python/modsupport.c index e9e025bdb2b..9637191feb8 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -586,57 +586,6 @@ va_build_stack(PyObject **small_stack, Py_ssize_t small_stack_len, } -PyObject * -PyEval_CallFunction(PyObject *callable, const char *format, ...) -{ - va_list vargs; - PyObject *args; - PyObject *res; - - va_start(vargs, format); - - args = Py_VaBuildValue(format, vargs); - va_end(vargs); - - if (args == NULL) - return NULL; - - res = PyEval_CallObject(callable, args); - Py_DECREF(args); - - return res; -} - - -PyObject * -PyEval_CallMethod(PyObject *obj, const char *name, const char *format, ...) -{ - va_list vargs; - PyObject *meth; - PyObject *args; - PyObject *res; - - meth = PyObject_GetAttrString(obj, name); - if (meth == NULL) - return NULL; - - va_start(vargs, format); - - args = Py_VaBuildValue(format, vargs); - va_end(vargs); - - if (args == NULL) { - Py_DECREF(meth); - return NULL; - } - - res = PyEval_CallObject(meth, args); - Py_DECREF(meth); - Py_DECREF(args); - - return res; -} - int PyModule_AddObject(PyObject *m, const char *name, PyObject *o) { -- cgit v1.2.3-65-gdbad