diff options
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r-- | Modules/mathmodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index 82a9a14..a75a3c9 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -1981,6 +1981,12 @@ math_factorial(PyObject *module, PyObject *arg) PyObject *result, *odd_part, *pyint_form; if (PyFloat_Check(arg)) { + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "Using factorial() with floats is deprecated", + 1) < 0) + { + return NULL; + } PyObject *lx; double dx = PyFloat_AS_DOUBLE((PyFloatObject *)arg); if (!(Py_IS_FINITE(dx) && dx == floor(dx))) { |