summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-12-25 18:49:11 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-12-25 18:49:11 (GMT)
commit54b11918beda8454dab062498af81754a7034055 (patch)
tree32e542aa601010a6d1de0f1a56be4890ca1ac4fb /Python/ceval.c
parent2826fade49f0bc8770a6a5e89f9ca94b7264a677 (diff)
downloadcpython-54b11918beda8454dab062498af81754a7034055.zip
cpython-54b11918beda8454dab062498af81754a7034055.tar.gz
cpython-54b11918beda8454dab062498af81754a7034055.tar.bz2
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.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 2feb123..e7ca82b 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();