diff options
author | Raymond Hettinger <python@rcn.com> | 2004-08-07 04:55:30 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-08-07 04:55:30 (GMT) |
commit | 2a7dedef9e3d94fbbad3782fd4757c6b7ba91c09 (patch) | |
tree | e2cd6d966dc61970931cc346c799031592ba7096 /Objects | |
parent | 61992efc4bb413ae7a19752215eca5af09be6b6d (diff) | |
download | cpython-2a7dedef9e3d94fbbad3782fd4757c6b7ba91c09.zip cpython-2a7dedef9e3d94fbbad3782fd4757c6b7ba91c09.tar.gz cpython-2a7dedef9e3d94fbbad3782fd4757c6b7ba91c09.tar.bz2 |
SF bug #1004669: Type returned from .keys() is not checked
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/object.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c index 470da60..d8e403b 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1702,6 +1702,11 @@ PyObject_Dir(PyObject *arg) } assert(result); + if (!PyList_Check(result)) { + PyErr_SetString(PyExc_TypeError, + "Expected keys() to be a list."); + goto error; + } if (PyList_Sort(result) != 0) goto error; else |