mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Get the locale and pwd tests working on the Solaris box where there
are some unicode values used. I'm not sure if this is the correct on all operating systems, but this works on Linux w/o unicode.
This commit is contained in:
parent
8866e0ab58
commit
3d7a90dea1
2 changed files with 9 additions and 4 deletions
|
@ -48,8 +48,11 @@ static PyTypeObject StructPwdType;
|
|||
static void
|
||||
sets(PyObject *v, int i, const char* val)
|
||||
{
|
||||
if (val)
|
||||
PyStructSequence_SET_ITEM(v, i, PyUnicode_FromString(val));
|
||||
if (val) {
|
||||
PyObject *o =
|
||||
PyUnicode_DecodeUnicodeEscape(val, strlen(val), "strict");
|
||||
PyStructSequence_SET_ITEM(v, i, o);
|
||||
}
|
||||
else {
|
||||
PyStructSequence_SET_ITEM(v, i, Py_None);
|
||||
Py_INCREF(Py_None);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue