diff options
author | Georg Brandl <georg@python.org> | 2008-05-16 13:24:29 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-16 13:24:29 (GMT) |
commit | ecf9091f59c31ca868dbf2d9626a9a697c1a084b (patch) | |
tree | 548e81e054f8df68f4168954fe5981e7791f96e9 /Objects | |
parent | 88107dafefd374f1eb743b5a2d74aab13e7aa9f7 (diff) | |
download | cpython-ecf9091f59c31ca868dbf2d9626a9a697c1a084b.zip cpython-ecf9091f59c31ca868dbf2d9626a9a697c1a084b.tar.gz cpython-ecf9091f59c31ca868dbf2d9626a9a697c1a084b.tar.bz2 |
Don't allow keyword arguments to reversed().
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/enumobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/enumobject.c b/Objects/enumobject.c index 0bacc83..dfa738d 100644 --- a/Objects/enumobject.c +++ b/Objects/enumobject.c @@ -224,7 +224,10 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds) PyObject *seq; reversedobject *ro; - if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq)) + if (type == &PyReversed_Type && !_PyArg_NoKeywords("reversed()", kwds)) + return NULL; + + if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq) ) return NULL; if (PyObject_HasAttrString(seq, "__reversed__")) |