]> granicus.if.org Git - python/commitdiff
Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 9 Feb 2007 12:19:46 +0000 (12:19 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 9 Feb 2007 12:19:46 +0000 (12:19 +0000)
Misc/NEWS
Objects/typeobject.c

index 4d9eaee3174b3e9b48adc6dbc57dbdb1e3ffbfa1..8cecda5857a13e7e76eb5349120c5a582d10a7ab 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 2.5.1c1?
 Core and builtins
 -----------------
 
+- Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
+
 - SF #151204:  enumerate() now raises an Overflow error at sys.maxint items.
 
 - Bug #1377858: Fix the segfaulting of the interpreter when an object created
index a8395ef9b23546f0e7a55276d787ab0795e3ce64..c4a20fd5c9fb25258a23ccb5985c7b2834939184 100644 (file)
@@ -4427,7 +4427,13 @@ SLOT1(slot_nb_inplace_subtract, "__isub__", PyObject *, "O")
 SLOT1(slot_nb_inplace_multiply, "__imul__", PyObject *, "O")
 SLOT1(slot_nb_inplace_divide, "__idiv__", PyObject *, "O")
 SLOT1(slot_nb_inplace_remainder, "__imod__", PyObject *, "O")
-SLOT1(slot_nb_inplace_power, "__ipow__", PyObject *, "O")
+/* Can't use SLOT1 here, because nb_inplace_power is ternary */
+static PyObject * 
+slot_nb_inplace_power(PyObject *self, PyObject * arg1, PyObject *arg2) 
+{ 
+  static PyObject *cache_str; 
+  return call_method(self, "__ipow__", &cache_str, "(" "O" ")", arg1); 
+}
 SLOT1(slot_nb_inplace_lshift, "__ilshift__", PyObject *, "O")
 SLOT1(slot_nb_inplace_rshift, "__irshift__", PyObject *, "O")
 SLOT1(slot_nb_inplace_and, "__iand__", PyObject *, "O")