would infinitely recourse and segfault the interpreter. Now a recursion check
occurs after a coercion.
Backport of fix for bug #992017.
Core and builtins
-----------------
+- Bug #992017: A classic class that defined a __coerce__() method that returned
+ its arguments swapped would infinitely recurse and segfault the interpreter.
+
- Bug #532646: The object set to the __call__ attribute has its own __call__
attribute checked; this continues until the attribute can no longer be found
or segfaulting. Recursion limit is now followed.
* argument */
result = generic_binary_op(v1, w, opname);
} else {
+ if (Py_EnterRecursiveCall(" after coercion"))
+ return NULL;
if (swapped)
result = (thisfunc)(w, v1);
else
result = (thisfunc)(v1, w);
+ Py_LeaveRecursiveCall();
}
Py_DECREF(coerced);
return result;