Issue #28376: Creating instances of range_iterator by calling range_iterator

type now is deprecated.  Patch by Oren Milman.
This commit is contained in:
Serhiy Storchaka 2016-10-08 21:50:45 +03:00
parent 639098c591
commit c7f490c8b1
3 changed files with 33 additions and 20 deletions

View file

@ -930,6 +930,13 @@ rangeiter_new(PyTypeObject *type, PyObject *args, PyObject *kw)
{
long start, stop, step;
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"range_iterator(): creating instances of range_iterator "
"by calling range_iterator type is deprecated",
1)) {
return NULL;
}
if (!_PyArg_NoKeywords("range_iterator()", kw)) {
return NULL;
}