Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 21537:ca27d82ac89b legacy-trunk
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.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Tue, 25 Dec 2001 18:49:11 +0000 |
| parents | ccb26a118867 |
| children | a6bb3cc919b9 3ba0f1b20320 |
line wrap: on
line diff
--- a/Python/ceval.c Sun Dec 23 13:54:19 2001 +0000 +++ b/Python/ceval.c Tue Dec 25 18:49:11 2001 +0000 @@ -1091,9 +1091,22 @@ 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 @@ 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();
