summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-10-31 04:01:15 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-10-31 04:01:15 (GMT)
commit2c05a2e01b18e9d10cd153308c4866909631e8c0 (patch)
tree6736bb6f4263c5f6609c74c41eb9e9b0799493b5 /Objects
parent8afa7fa51064848d826e4eb8a2bd46cf7f730b0f (diff)
downloadcpython-2c05a2e01b18e9d10cd153308c4866909631e8c0.zip
cpython-2c05a2e01b18e9d10cd153308c4866909631e8c0.tar.gz
cpython-2c05a2e01b18e9d10cd153308c4866909631e8c0.tar.bz2
do safety checks on __qualname__ assignment
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 9f0d13e..413c7da 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -311,6 +311,8 @@ type_set_qualname(PyTypeObject *type, PyObject *value, void *context)
{
PyHeapTypeObject* et;
+ if (!check_set_special_type_attr(type, value, "__qualname__"))
+ return -1;
if (!PyUnicode_Check(value)) {
PyErr_Format(PyExc_TypeError,
"can only assign string to %s.__qualname__, not '%s'",