summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/structmember.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/Python/structmember.c b/Python/structmember.c
index ddedea5..af0296d 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;
}