Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69cf3c7

Browse files
committed
Deprecate % as well. The message for deprecation of //, % and divmod
is the same in all three cases (mostly because // calls divmod :-).
1 parent 862fe3c commit 69cf3c7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Objects/complexobject.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@ static PyObject *
399399
complex_remainder(PyComplexObject *v, PyComplexObject *w)
400400
{
401401
Py_complex div, mod;
402+
403+
if (PyErr_Warn(PyExc_DeprecationWarning,
404+
"complex divmod(), // and % are deprecated") < 0)
405+
return NULL;
406+
402407
errno = 0;
403408
div = c_quot(v->cval,w->cval); /* The raw divisor value. */
404409
if (errno == EDOM) {
@@ -420,7 +425,7 @@ complex_divmod(PyComplexObject *v, PyComplexObject *w)
420425
PyObject *d, *m, *z;
421426

422427
if (PyErr_Warn(PyExc_DeprecationWarning,
423-
"complex divmod() and // are deprecated") < 0)
428+
"complex divmod(), // and % are deprecated") < 0)
424429
return NULL;
425430

426431
errno = 0;

0 commit comments

Comments
 (0)