diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/enumobject.c | 5 | ||||
-rw-r--r-- | Objects/genobject.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/Objects/enumobject.c b/Objects/enumobject.c index 5c60d8c..c1a1872 100644 --- a/Objects/enumobject.c +++ b/Objects/enumobject.c @@ -217,7 +217,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__")) diff --git a/Objects/genobject.c b/Objects/genobject.c index c76bcb6..72ddaef 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -285,7 +285,7 @@ gen_iternext(PyGenObject *gen) static PyObject * gen_repr(PyGenObject *gen) { - return PyUnicode_FromFormat("<%S generator object at %p>", + return PyUnicode_FromFormat("<generator object %S at %p>", ((PyCodeObject *)gen->gi_code)->co_name, gen); } |