From: Michael W. Hudson Date: Fri, 28 Dec 2001 10:22:15 +0000 (+0000) Subject: Backport tim_one's checkin of version 2.302: X-Git-Tag: v2.2.1c1~259 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fde86fad5cc7718d6b86353ea7f05b28bcc26bf;p=thirdparty%2FPython%2Fcpython.git Backport tim_one's checkin of version 2.302: SF bug #496549 -Qnew and in-place division "/=". eval_frame(): Under -Qnew, INPLACE_DIVIDE wasn't getting handed off to INPLACE_TRUE_DIVIDE (like BINARY_DIVIDE was getting handed off to BINARY_TRUE_DIVIDE). Bugfix candidate. --- diff --git a/Python/ceval.c b/Python/ceval.c index 2feb123a9c6f..e7ca82bc1a42 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1091,9 +1091,22 @@ eval_frame(PyFrameObject *f) break; case INPLACE_DIVIDE: + if (!_Py_QnewFlag) { + w = POP(); + v = POP(); + x = PyNumber_InPlaceDivide(v, w); + Py_DECREF(v); + Py_DECREF(w); + PUSH(x); + if (x != NULL) continue; + break; + } + /* -Qnew is in effect: fall through to + INPLACE_TRUE_DIVIDE */ + case INPLACE_TRUE_DIVIDE: w = POP(); v = POP(); - x = PyNumber_InPlaceDivide(v, w); + x = PyNumber_InPlaceTrueDivide(v, w); Py_DECREF(v); Py_DECREF(w); PUSH(x); @@ -1110,16 +1123,6 @@ eval_frame(PyFrameObject *f) if (x != NULL) continue; break; - case INPLACE_TRUE_DIVIDE: - w = POP(); - v = POP(); - x = PyNumber_InPlaceTrueDivide(v, w); - Py_DECREF(v); - Py_DECREF(w); - PUSH(x); - if (x != NULL) continue; - break; - case INPLACE_MODULO: w = POP(); v = POP();