diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-03-16 14:35:38 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-03-16 14:35:38 (GMT) |
commit | de394543b4d31c0226fd8700475adccf6a3eb934 (patch) | |
tree | 07bd78cd2fa7643f72b20f7fededc6da15ee45f3 /Objects | |
parent | 6e335250987a1b200c4d68979586677fbcd00f4e (diff) | |
parent | 16d84ac355c532a1e7d25cf75e0b577923de2856 (diff) | |
download | cpython-de394543b4d31c0226fd8700475adccf6a3eb934.zip cpython-de394543b4d31c0226fd8700475adccf6a3eb934.tar.gz cpython-de394543b4d31c0226fd8700475adccf6a3eb934.tar.bz2 |
merge 3.2 (#14334)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 4487322..db0b042 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2486,6 +2486,13 @@ type_getattro(PyTypeObject *type, PyObject *name) PyObject *meta_attribute, *attribute; descrgetfunc meta_get; + if (!PyUnicode_Check(name)) { + PyErr_Format(PyExc_TypeError, + "attribute name must be string, not '%.200s'", + name->ob_type->tp_name); + return NULL; + } + /* Initialize this type (we'll assume the metatype is initialized) */ if (type->tp_dict == NULL) { if (PyType_Ready(type) < 0) |