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.
This commit is contained in:
Guido van Rossum 2001-09-04 03:51:09 +00:00
parent 61c345fa37
commit 1832de4bc0
4 changed files with 11 additions and 7 deletions

View file

@ -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) {