diff options
author | Georg Brandl <georg@python.org> | 2012-09-29 09:27:15 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-09-29 09:27:15 +0200 |
commit | 99a247fd01c1cd780c0c3ee1116657627f1ee744 (patch) | |
tree | 319e33cb6612c3fafb2eb82e15c5e85e3d771e4f /Python/structmember.c | |
parent | 1628eaa5dc8892ff381ca7558cc7c8d80fac494d (diff) | |
parent | 8ed677db129171317b8ee7cd45b39b9013f5a2d6 (diff) | |
download | cpython-git-99a247fd01c1cd780c0c3ee1116657627f1ee744.tar.gz |
Merge with main repo default branch.
Diffstat (limited to 'Python/structmember.c')
-rw-r--r-- | Python/structmember.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Python/structmember.c b/Python/structmember.c index ddedea5419..af0296d802 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -254,12 +254,8 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) char *string; Py_ssize_t len; - if (!PyUnicode_Check(v)) { - PyErr_BadArgument(); - return -1; - } string = _PyUnicode_AsStringAndSize(v, &len); - if (len != 1) { + if (string == NULL || len != 1) { PyErr_BadArgument(); return -1; } |