summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-04 03:51:09 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-04 03:51:09 (GMT)
commit1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2 (patch)
tree2d41b60cbaa6176a1b889a7d15d1f11449c1ddaa /Objects
parent61c345fa37573005b708d239c0911218ca22383c (diff)
downloadcpython-1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2.zip
cpython-1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2.tar.gz
cpython-1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2.tar.bz2
PEP 238 documented -Qwarn as warning only for classic int or long
division, and this makes sense. Add -Qwarnall to warn for all classic divisions, as required by the fixdiv.py tool.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/complexobject.c2
-rw-r--r--Objects/floatobject.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 281de13..236f4d5 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -377,7 +377,7 @@ complex_classic_div(PyComplexObject *v, PyComplexObject *w)
{
Py_complex quot;
- if (Py_DivisionWarningFlag &&
+ if (Py_DivisionWarningFlag >= 2 &&
PyErr_Warn(PyExc_DeprecationWarning,
"classic complex division") < 0)
return NULL;
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 8cd26b4..478e131 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -419,7 +419,7 @@ float_classic_div(PyObject *v, PyObject *w)
double a,b;
CONVERT_TO_DOUBLE(v, a);
CONVERT_TO_DOUBLE(w, b);
- if (Py_DivisionWarningFlag &&
+ if (Py_DivisionWarningFlag >= 2 &&
PyErr_Warn(PyExc_DeprecationWarning, "classic float division") < 0)
return NULL;
if (b == 0.0) {