Kaydet (Commit) 8be1c39e authored tarafından Victor Stinner's avatar Victor Stinner

Backed out changeset 7efddbf1aa70

üst ebea9988
...@@ -257,15 +257,15 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ ...@@ -257,15 +257,15 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* Declared elsewhere /* Declared elsewhere
PyAPI_FUNC(int) PyCallable_Check(PyObject *obj); PyAPI_FUNC(int) PyCallable_Check(PyObject *o);
Determine if the object, obj, is callable. Return 1 if the Determine if the object, o, is callable. Return 1 if the
object is callable and 0 otherwise. object is callable and 0 otherwise.
This function always succeeds. This function always succeeds.
*/ */
PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *func, PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable_object,
PyObject *args, PyObject *kwargs); PyObject *args, PyObject *kwargs);
#ifndef Py_LIMITED_API #ifndef Py_LIMITED_API
...@@ -344,7 +344,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ ...@@ -344,7 +344,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
_PyObject_FastCall((func), &(arg), 1) _PyObject_FastCall((func), &(arg), 1)
PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend(PyObject *func, PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend(PyObject *func,
PyObject *arg0, PyObject *args, PyObject *obj, PyObject *args,
PyObject *kwargs); PyObject *kwargs);
PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *func, PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *func,
...@@ -353,27 +353,27 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ ...@@ -353,27 +353,27 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
#endif /* Py_LIMITED_API */ #endif /* Py_LIMITED_API */
/* /*
Call a callable Python object, func, with Call a callable Python object, callable_object, with
arguments and keywords arguments. The 'args' argument can not be arguments and keywords arguments. The 'args' argument can not be
NULL. NULL.
*/ */
PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *func, PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *callable_object,
PyObject *args); PyObject *args);
/* /*
Call a callable Python object, func, with Call a callable Python object, callable_object, with
arguments given by the tuple, args. If no arguments are arguments given by the tuple, args. If no arguments are
needed, then args may be NULL. Returns the result of the needed, then args may be NULL. Returns the result of the
call on success, or NULL on failure. This is the equivalent call on success, or NULL on failure. This is the equivalent
of the Python expression: o(*args). of the Python expression: o(*args).
*/ */
PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *func, PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object,
const char *format, ...); const char *format, ...);
/* /*
Call a callable Python object, func, with a Call a callable Python object, callable_object, with a
variable number of C arguments. The C arguments are described variable number of C arguments. The C arguments are described
using a mkvalue-style format string. The format may be NULL, using a mkvalue-style format string. The format may be NULL,
indicating that no arguments are provided. Returns the indicating that no arguments are provided. Returns the
...@@ -382,7 +382,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ ...@@ -382,7 +382,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/ */
PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *obj, PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o,
const char *method, const char *method,
const char *format, ...); const char *format, ...);
...@@ -396,7 +396,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ ...@@ -396,7 +396,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/ */
#ifndef Py_LIMITED_API #ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj, PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *o,
_Py_Identifier *method, _Py_Identifier *method,
const char *format, ...); const char *format, ...);
...@@ -406,25 +406,25 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ ...@@ -406,25 +406,25 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/ */
#endif /* !Py_LIMITED_API */ #endif /* !Py_LIMITED_API */
PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *func, PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable,
const char *format, const char *format,
...); ...);
PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *obj, PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *o,
const char *method, const char *name,
const char *format, const char *format,
...); ...);
#ifndef Py_LIMITED_API #ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj, PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *o,
_Py_Identifier *method, _Py_Identifier *name,
const char *format, const char *format,
...); ...);
#endif /* !Py_LIMITED_API */ #endif /* !Py_LIMITED_API */
PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *func, PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable,
...); ...);
/* /*
Call a callable Python object, func, with a Call a callable Python object, callable_object, with a
variable number of C arguments. The C arguments are provided variable number of C arguments. The C arguments are provided
as PyObject * values, terminated by a NULL. Returns the as PyObject * values, terminated by a NULL. Returns the
result of the call on success, or NULL on failure. This is result of the call on success, or NULL on failure. This is
...@@ -432,10 +432,10 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ ...@@ -432,10 +432,10 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/ */
PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *obj, PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *o,
PyObject *method, ...); PyObject *method, ...);
#ifndef Py_LIMITED_API #ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(PyObject *obj, PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(PyObject *o,
struct _Py_Identifier *method, struct _Py_Identifier *method,
...); ...);
#endif /* !Py_LIMITED_API */ #endif /* !Py_LIMITED_API */
......
...@@ -14,10 +14,10 @@ PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords( ...@@ -14,10 +14,10 @@ PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
#define PyEval_CallObject(func,arg) \ #define PyEval_CallObject(func,arg) \
PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL) PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)
PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *func, PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *obj,
const char *format, ...); const char *format, ...);
PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj, PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
const char *method, const char *methodname,
const char *format, ...); const char *format, ...);
#ifndef Py_LIMITED_API #ifndef Py_LIMITED_API
......
...@@ -2173,9 +2173,9 @@ PyMapping_Values(PyObject *o) ...@@ -2173,9 +2173,9 @@ PyMapping_Values(PyObject *o)
/* XXX PyCallable_Check() is in object.c */ /* XXX PyCallable_Check() is in object.c */
PyObject * PyObject *
PyObject_CallObject(PyObject *func, PyObject *args) PyObject_CallObject(PyObject *o, PyObject *a)
{ {
return PyEval_CallObjectWithKeywords(func, args, NULL); return PyEval_CallObjectWithKeywords(o, a, NULL);
} }
PyObject* PyObject*
...@@ -2331,10 +2331,10 @@ exit: ...@@ -2331,10 +2331,10 @@ exit:
return result; return result;
} }
/* Positional arguments are arg0 followed args: [arg0, *args]. */ /* Positional arguments are obj followed args. */
PyObject * PyObject *
_PyObject_Call_Prepend(PyObject *func, _PyObject_Call_Prepend(PyObject *func,
PyObject *arg0, PyObject *args, PyObject *kwargs) PyObject *obj, PyObject *args, PyObject *kwargs)
{ {
PyObject *small_stack[8]; PyObject *small_stack[8];
PyObject **stack; PyObject **stack;
...@@ -2356,7 +2356,7 @@ _PyObject_Call_Prepend(PyObject *func, ...@@ -2356,7 +2356,7 @@ _PyObject_Call_Prepend(PyObject *func,
} }
/* use borrowed references */ /* use borrowed references */
stack[0] = arg0; stack[0] = obj;
memcpy(&stack[1], memcpy(&stack[1],
&PyTuple_GET_ITEM(args, 0), &PyTuple_GET_ITEM(args, 0),
argcount * sizeof(PyObject *)); argcount * sizeof(PyObject *));
...@@ -2489,34 +2489,34 @@ _PyObject_FastCallKeywords(PyObject *func, PyObject **stack, Py_ssize_t nargs, ...@@ -2489,34 +2489,34 @@ _PyObject_FastCallKeywords(PyObject *func, PyObject **stack, Py_ssize_t nargs,
} }
static PyObject* static PyObject*
call_function_tail(PyObject *func, PyObject *args) call_function_tail(PyObject *callable, PyObject *args)
{ {
PyObject *result; PyObject *result;
assert(args != NULL); assert(args != NULL);
if (!PyTuple_Check(args)) { if (!PyTuple_Check(args)) {
result = _PyObject_CallArg1(func, args); result = _PyObject_CallArg1(callable, args);
} }
else { else {
result = PyObject_Call(func, args, NULL); result = PyObject_Call(callable, args, NULL);
} }
return result; return result;
} }
PyObject * PyObject *
PyObject_CallFunction(PyObject *func, const char *format, ...) PyObject_CallFunction(PyObject *callable, const char *format, ...)
{ {
va_list va; va_list va;
PyObject *args, *result; PyObject *args, *result;
if (func == NULL) { if (callable == NULL) {
return null_error(); return null_error();
} }
if (!format || !*format) { if (!format || !*format) {
return _PyObject_CallNoArg(func); return _PyObject_CallNoArg(callable);
} }
va_start(va, format); va_start(va, format);
...@@ -2526,23 +2526,23 @@ PyObject_CallFunction(PyObject *func, const char *format, ...) ...@@ -2526,23 +2526,23 @@ PyObject_CallFunction(PyObject *func, const char *format, ...)
return NULL; return NULL;
} }
result = call_function_tail(func, args); result = call_function_tail(callable, args);
Py_DECREF(args); Py_DECREF(args);
return result; return result;
} }
PyObject * PyObject *
_PyObject_CallFunction_SizeT(PyObject *func, const char *format, ...) _PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...)
{ {
va_list va; va_list va;
PyObject *args, *result; PyObject *args, *result;
if (func == NULL) { if (callable == NULL) {
return null_error(); return null_error();
} }
if (!format || !*format) { if (!format || !*format) {
return _PyObject_CallNoArg(func); return _PyObject_CallNoArg(callable);
} }
va_start(va, format); va_start(va, format);
...@@ -2552,7 +2552,7 @@ _PyObject_CallFunction_SizeT(PyObject *func, const char *format, ...) ...@@ -2552,7 +2552,7 @@ _PyObject_CallFunction_SizeT(PyObject *func, const char *format, ...)
return NULL; return NULL;
} }
result = call_function_tail(func, args); result = call_function_tail(callable, args);
Py_DECREF(args); Py_DECREF(args);
return result; return result;
} }
...@@ -2589,20 +2589,19 @@ callmethod(PyObject* func, const char *format, va_list va, int is_size_t) ...@@ -2589,20 +2589,19 @@ callmethod(PyObject* func, const char *format, va_list va, int is_size_t)
} }
PyObject * PyObject *
PyObject_CallMethod(PyObject *obj, const char *method, const char *format, ...) PyObject_CallMethod(PyObject *o, const char *name, const char *format, ...)
{ {
va_list va; va_list va;
PyObject *func = NULL; PyObject *func = NULL;
PyObject *retval = NULL; PyObject *retval = NULL;
if (obj == NULL || method == NULL) { if (o == NULL || name == NULL) {
return null_error(); return null_error();
} }
func = PyObject_GetAttrString(obj, method); func = PyObject_GetAttrString(o, name);
if (func == NULL) { if (func == NULL)
return NULL; return NULL;
}
va_start(va, format); va_start(va, format);
retval = callmethod(func, format, va, 0); retval = callmethod(func, format, va, 0);
...@@ -2612,20 +2611,20 @@ PyObject_CallMethod(PyObject *obj, const char *method, const char *format, ...) ...@@ -2612,20 +2611,20 @@ PyObject_CallMethod(PyObject *obj, const char *method, const char *format, ...)
} }
PyObject * PyObject *
_PyObject_CallMethodId(PyObject *obj, _Py_Identifier *method, _PyObject_CallMethodId(PyObject *o, _Py_Identifier *name,
const char *format, ...) const char *format, ...)
{ {
va_list va; va_list va;
PyObject *func, *retval; PyObject *func = NULL;
PyObject *retval = NULL;
if (obj == NULL || method == NULL) { if (o == NULL || name == NULL) {
return null_error(); return null_error();
} }
func = _PyObject_GetAttrId(obj, method); func = _PyObject_GetAttrId(o, name);
if (func == NULL) { if (func == NULL)
return NULL; return NULL;
}
va_start(va, format); va_start(va, format);
retval = callmethod(func, format, va, 0); retval = callmethod(func, format, va, 0);
...@@ -2635,21 +2634,20 @@ _PyObject_CallMethodId(PyObject *obj, _Py_Identifier *method, ...@@ -2635,21 +2634,20 @@ _PyObject_CallMethodId(PyObject *obj, _Py_Identifier *method,
} }
PyObject * PyObject *
_PyObject_CallMethod_SizeT(PyObject *obj, const char *method, _PyObject_CallMethod_SizeT(PyObject *o, const char *name,
const char *format, ...) const char *format, ...)
{ {
va_list va; va_list va;
PyObject *func, *retval; PyObject *func = NULL;
PyObject *retval;
if (obj == NULL || method == NULL) { if (o == NULL || name == NULL) {
return null_error(); return null_error();
} }
func = PyObject_GetAttrString(obj, method); func = PyObject_GetAttrString(o, name);
if (func == NULL) { if (func == NULL)
return NULL; return NULL;
}
va_start(va, format); va_start(va, format);
retval = callmethod(func, format, va, 1); retval = callmethod(func, format, va, 1);
va_end(va); va_end(va);
...@@ -2658,21 +2656,21 @@ _PyObject_CallMethod_SizeT(PyObject *obj, const char *method, ...@@ -2658,21 +2656,21 @@ _PyObject_CallMethod_SizeT(PyObject *obj, const char *method,
} }
PyObject * PyObject *
_PyObject_CallMethodId_SizeT(PyObject *obj, _Py_Identifier *method, _PyObject_CallMethodId_SizeT(PyObject *o, _Py_Identifier *name,
const char *format, ...) const char *format, ...)
{ {
va_list va; va_list va;
PyObject *func, *retval; PyObject *func = NULL;
PyObject *retval;
if (obj == NULL || method == NULL) { if (o == NULL || name == NULL) {
return null_error(); return null_error();
} }
func = _PyObject_GetAttrId(obj, method); func = _PyObject_GetAttrId(o, name);
if (func == NULL) { if (func == NULL) {
return NULL; return NULL;
} }
va_start(va, format); va_start(va, format);
retval = callmethod(func, format, va, 1); retval = callmethod(func, format, va, 1);
va_end(va); va_end(va);
...@@ -2722,34 +2720,34 @@ objargs_mkstack(PyObject **small_stack, Py_ssize_t small_stack_size, ...@@ -2722,34 +2720,34 @@ objargs_mkstack(PyObject **small_stack, Py_ssize_t small_stack_size,
} }
PyObject * PyObject *
PyObject_CallMethodObjArgs(PyObject *obj, PyObject *method, ...) PyObject_CallMethodObjArgs(PyObject *callable, PyObject *name, ...)
{ {
PyObject *small_stack[5]; PyObject *small_stack[5];
PyObject **stack; PyObject **stack;
Py_ssize_t nargs; Py_ssize_t nargs;
PyObject *func, *result; PyObject *result;
va_list vargs; va_list vargs;
if (obj == NULL || method == NULL) { if (callable == NULL || name == NULL) {
return null_error(); return null_error();
} }
func = PyObject_GetAttr(obj, method); callable = PyObject_GetAttr(callable, name);
if (func == NULL) if (callable == NULL)
return NULL; return NULL;
/* count the args */ /* count the args */
va_start(vargs, method); va_start(vargs, name);
stack = objargs_mkstack(small_stack, Py_ARRAY_LENGTH(small_stack), stack = objargs_mkstack(small_stack, Py_ARRAY_LENGTH(small_stack),
vargs, &nargs); vargs, &nargs);
va_end(vargs); va_end(vargs);
if (stack == NULL) { if (stack == NULL) {
Py_DECREF(func); Py_DECREF(callable);
return NULL; return NULL;
} }
result = _PyObject_FastCall(func, stack, nargs); result = _PyObject_FastCall(callable, stack, nargs);
Py_DECREF(func); Py_DECREF(callable);
if (stack != small_stack) { if (stack != small_stack) {
PyMem_Free(stack); PyMem_Free(stack);
} }
...@@ -2758,35 +2756,35 @@ PyObject_CallMethodObjArgs(PyObject *obj, PyObject *method, ...) ...@@ -2758,35 +2756,35 @@ PyObject_CallMethodObjArgs(PyObject *obj, PyObject *method, ...)
} }
PyObject * PyObject *
_PyObject_CallMethodIdObjArgs(PyObject *obj, _PyObject_CallMethodIdObjArgs(PyObject *callable,
struct _Py_Identifier *method, ...) struct _Py_Identifier *name, ...)
{ {
PyObject *small_stack[5]; PyObject *small_stack[5];
PyObject **stack; PyObject **stack;
Py_ssize_t nargs; Py_ssize_t nargs;
PyObject *func, *result; PyObject *result;
va_list vargs; va_list vargs;
if (obj == NULL || method == NULL) { if (callable == NULL || name == NULL) {
return null_error(); return null_error();
} }
func = _PyObject_GetAttrId(obj, method); callable = _PyObject_GetAttrId(callable, name);
if (func == NULL) if (callable == NULL)
return NULL; return NULL;
/* count the args */ /* count the args */
va_start(vargs, method); va_start(vargs, name);
stack = objargs_mkstack(small_stack, Py_ARRAY_LENGTH(small_stack), stack = objargs_mkstack(small_stack, Py_ARRAY_LENGTH(small_stack),
vargs, &nargs); vargs, &nargs);
va_end(vargs); va_end(vargs);
if (stack == NULL) { if (stack == NULL) {
Py_DECREF(func); Py_DECREF(callable);
return NULL; return NULL;
} }
result = _PyObject_FastCall(func, stack, nargs); result = _PyObject_FastCall(callable, stack, nargs);
Py_DECREF(func); Py_DECREF(callable);
if (stack != small_stack) { if (stack != small_stack) {
PyMem_Free(stack); PyMem_Free(stack);
} }
...@@ -2795,7 +2793,7 @@ _PyObject_CallMethodIdObjArgs(PyObject *obj, ...@@ -2795,7 +2793,7 @@ _PyObject_CallMethodIdObjArgs(PyObject *obj,
} }
PyObject * PyObject *
PyObject_CallFunctionObjArgs(PyObject *func, ...) PyObject_CallFunctionObjArgs(PyObject *callable, ...)
{ {
PyObject *small_stack[5]; PyObject *small_stack[5];
PyObject **stack; PyObject **stack;
...@@ -2803,12 +2801,12 @@ PyObject_CallFunctionObjArgs(PyObject *func, ...) ...@@ -2803,12 +2801,12 @@ PyObject_CallFunctionObjArgs(PyObject *func, ...)
PyObject *result; PyObject *result;
va_list vargs; va_list vargs;
if (func == NULL) { if (callable == NULL) {
return null_error(); return null_error();
} }
/* count the args */ /* count the args */
va_start(vargs, func); va_start(vargs, callable);
stack = objargs_mkstack(small_stack, Py_ARRAY_LENGTH(small_stack), stack = objargs_mkstack(small_stack, Py_ARRAY_LENGTH(small_stack),
vargs, &nargs); vargs, &nargs);
va_end(vargs); va_end(vargs);
...@@ -2816,7 +2814,7 @@ PyObject_CallFunctionObjArgs(PyObject *func, ...) ...@@ -2816,7 +2814,7 @@ PyObject_CallFunctionObjArgs(PyObject *func, ...)
return NULL; return NULL;
} }
result = _PyObject_FastCall(func, stack, nargs); result = _PyObject_FastCall(callable, stack, nargs);
if (stack != small_stack) { if (stack != small_stack) {
PyMem_Free(stack); PyMem_Free(stack);
} }
......
...@@ -1425,16 +1425,15 @@ _PyObject_LookupSpecial(PyObject *self, _Py_Identifier *attrid) ...@@ -1425,16 +1425,15 @@ _PyObject_LookupSpecial(PyObject *self, _Py_Identifier *attrid)
as lookup_method to cache the interned name string object. */ as lookup_method to cache the interned name string object. */
static PyObject * static PyObject *
call_method(PyObject *obj, _Py_Identifier *method, const char *format, ...) call_method(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
{ {
va_list va; va_list va;
PyObject *func, *retval; PyObject *func = NULL, *retval;
func = lookup_maybe(obj, method); func = lookup_maybe(o, nameid);
if (func == NULL) { if (func == NULL) {
if (!PyErr_Occurred()) { if (!PyErr_Occurred())
PyErr_SetObject(PyExc_AttributeError, method->object); PyErr_SetObject(PyExc_AttributeError, nameid->object);
}
return NULL; return NULL;
} }
...@@ -1466,12 +1465,12 @@ call_method(PyObject *obj, _Py_Identifier *method, const char *format, ...) ...@@ -1466,12 +1465,12 @@ call_method(PyObject *obj, _Py_Identifier *method, const char *format, ...)
/* Clone of call_method() that returns NotImplemented when the lookup fails. */ /* Clone of call_method() that returns NotImplemented when the lookup fails. */
static PyObject * static PyObject *
call_maybe(PyObject *obj, _Py_Identifier *method, const char *format, ...) call_maybe(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
{ {
va_list va; va_list va;
PyObject *func, *retval; PyObject *func = NULL, *retval;
func = lookup_maybe(obj, method); func = lookup_maybe(o, nameid);
if (func == NULL) { if (func == NULL) {
if (!PyErr_Occurred()) if (!PyErr_Occurred())
Py_RETURN_NOTIMPLEMENTED; Py_RETURN_NOTIMPLEMENTED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment