Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Properly flatten call to PyUnicode_AsWideChar
  • Loading branch information
ZeroIntensity committed Jan 6, 2025
commit d720d9ab18dc506f2bb36fee3ea5b5145483159b
7 changes: 2 additions & 5 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1552,12 +1552,9 @@ WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored
return -1;
}
LOCK_PTR(self);
if (PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, size) < 0) {
UNLOCK_PTR(self);
return -1;
}
int rc = PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, size);
UNLOCK_PTR(self);
return 0;
return rc < 0 ? -1 : 0;
}

static PyGetSetDef WCharArray_getsets[] = {
Expand Down