Skip to content

Commit 1c92b4b

Browse files
committed
Flatten call to PyUnicode_AsWideChar
1 parent 32a885f commit 1c92b4b

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎Modules/_ctypes/_ctypes.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,12 +1552,9 @@ WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored
15521552
return -1;
15531553
}
15541554
LOCK_PTR(self);
1555-
if (PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, size) < 0) {
1556-
UNLOCK_PTR(self);
1557-
return -1;
1558-
}
1555+
int rc = PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, size);
15591556
UNLOCK_PTR(self);
1560-
return 0;
1557+
return rc;
15611558
}
15621559

15631560
static PyGetSetDef WCharArray_getsets[] = {

0 commit comments

Comments
 (0)