mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
gh-139927: Fix test_embed on OpenIndiana (#142514)
Avoid swprintf() function in Programs/_testembed.c since it doesn't work as expected on OpenIndiana.
This commit is contained in:
parent
2db9573e23
commit
c76cfe8d89
1 changed files with 14 additions and 9 deletions
|
|
@ -2063,15 +2063,20 @@ static int check_use_frozen_modules(const char *rawval)
|
||||||
if (rawval == NULL) {
|
if (rawval == NULL) {
|
||||||
wcscpy(optval, L"frozen_modules");
|
wcscpy(optval, L"frozen_modules");
|
||||||
}
|
}
|
||||||
else if (swprintf(optval, 100,
|
else {
|
||||||
#if defined(_MSC_VER)
|
wchar_t *val = Py_DecodeLocale(rawval, NULL);
|
||||||
L"frozen_modules=%S",
|
if (val == NULL) {
|
||||||
#else
|
error("unable to decode TESTFROZEN");
|
||||||
L"frozen_modules=%s",
|
return -1;
|
||||||
#endif
|
}
|
||||||
rawval) < 0) {
|
wcscpy(optval, L"frozen_modules=");
|
||||||
error("rawval is too long");
|
if ((wcslen(optval) + wcslen(val)) >= Py_ARRAY_LENGTH(optval)) {
|
||||||
return -1;
|
error("TESTFROZEN is too long");
|
||||||
|
PyMem_RawFree(val);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
wcscat(optval, val);
|
||||||
|
PyMem_RawFree(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
PyConfig config;
|
PyConfig config;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue