mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Disallow keyword arguments for type constructors that don't use them.
(fixes bug #1119418)
This commit is contained in:
parent
bd77da6dab
commit
02c42871cf
13 changed files with 100 additions and 13 deletions
|
|
@ -45,6 +45,9 @@ range_new(PyTypeObject *type, PyObject *args, PyObject *kw)
|
|||
long ilow = 0, ihigh = 0, istep = 1;
|
||||
long n;
|
||||
|
||||
if (!_PyArg_NoKeywords("xrange()", kw))
|
||||
return NULL;
|
||||
|
||||
if (PyTuple_Size(args) <= 1) {
|
||||
if (!PyArg_ParseTuple(args,
|
||||
"l;xrange() requires 1-3 int arguments",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue