]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport gvanrossum's patch:
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 18 Apr 2002 05:39:54 +0000 (05:39 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 18 Apr 2002 05:39:54 +0000 (05:39 +0000)
Deprecate % as well.  The message for deprecation of //, % and divmod
is the same in all three cases (mostly because // calls divmod :-).

Original patches were:
python/dist/src/Objects/complexobject.c:2.59

Objects/complexobject.c

index 5e4654622ba7a5be86778f3c5d527a98e1ef1223..f90e61dbd609a5db3bb0375959f64cc4649ffc2f 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;