diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-08 18:50:45 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-08 18:50:45 (GMT) |
commit | c7f490c8b19d5458d692f243279f7ad898f13ec4 (patch) | |
tree | 00696e8d0c669e8d4a413ecb04a8dae715aa59da /Objects | |
parent | 639098c5911b88f03972e7fd44fe230a651cbc9b (diff) | |
download | cpython-c7f490c8b19d5458d692f243279f7ad898f13ec4.zip cpython-c7f490c8b19d5458d692f243279f7ad898f13ec4.tar.gz cpython-c7f490c8b19d5458d692f243279f7ad898f13ec4.tar.bz2 |
Issue #28376: Creating instances of range_iterator by calling range_iterator
type now is deprecated. Patch by Oren Milman.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/rangeobject.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index eb18611..8449fc7 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -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; } |