]> granicus.if.org Git - python/commitdiff
Deprecate % as well. The message for deprecation of //, % and divmod
authorGuido van Rossum <guido@python.org>
Mon, 15 Apr 2002 12:39:12 +0000 (12:39 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 15 Apr 2002 12:39:12 +0000 (12:39 +0000)
is the same in all three cases (mostly because // calls divmod :-).

Objects/complexobject.c

index 3c26b5b243bb2de5afd144c603530aa708e62172..adcf85a9fadae29631486b50999383869906af69 100644 (file)
@@ -399,6 +399,11 @@ static PyObject *
 complex_remainder(PyComplexObject *v, PyComplexObject *w)
 {
         Py_complex div, mod;
+
+       if (PyErr_Warn(PyExc_DeprecationWarning,
+                      "complex divmod(), // and % are deprecated") < 0)
+               return NULL;
+
        errno = 0;
        div = c_quot(v->cval,w->cval); /* The raw divisor value. */
        if (errno == EDOM) {
@@ -420,7 +425,7 @@ complex_divmod(PyComplexObject *v, PyComplexObject *w)
        PyObject *d, *m, *z;
 
        if (PyErr_Warn(PyExc_DeprecationWarning,
-                      "complex divmod() and // are deprecated") < 0)
+                      "complex divmod(), // and % are deprecated") < 0)
                return NULL;
 
        errno = 0;