diff options
author | Sam Gross <colesbury@gmail.com> | 2024-12-04 08:58:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-04 08:58:22 (GMT) |
commit | 6fc643674983e27ec5cc312f2e83468050d1d364 (patch) | |
tree | de56560ca1b685e2eb0e4a2c93e5e923dfaf7f38 /Modules/_testcapi | |
parent | 7f882c88cfda486947974cb82c20a1ae7047edfc (diff) | |
download | cpython-6fc643674983e27ec5cc312f2e83468050d1d364.zip cpython-6fc643674983e27ec5cc312f2e83468050d1d364.tar.gz cpython-6fc643674983e27ec5cc312f2e83468050d1d364.tar.bz2 |
gh-127572: Fix `test_structmembers` initialization (GH-127577)
gh-127572: Fix `test_structmembers` initialization.
The 'C' format code expects an `int` as a destination (not a `char`).
This led to test failures on big-endian platforms like s390x. Use the
'c' format code, which expects a `char` as the destination (but requires
a Python byte objects instead of a str).
Diffstat (limited to 'Modules/_testcapi')
-rw-r--r-- | Modules/_testcapi/structmember.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_testcapi/structmember.c b/Modules/_testcapi/structmember.c index c1861db..ef30a5a 100644 --- a/Modules/_testcapi/structmember.c +++ b/Modules/_testcapi/structmember.c @@ -60,7 +60,7 @@ test_structmembers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) "T_FLOAT", "T_DOUBLE", "T_STRING_INPLACE", "T_LONGLONG", "T_ULONGLONG", "T_CHAR", NULL}; - static const char fmt[] = "|bbBhHiIlknfds#LKC"; + static const char fmt[] = "|bbBhHiIlknfds#LKc"; test_structmembers *ob; const char *s = NULL; Py_ssize_t string_len = 0; |