mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #2173: fix build failure on OS X. device_encoding was returning an
empty string, causing an (invisible) LookupError on any attempt to write to sys.stdout.
This commit is contained in:
parent
b99d1cde07
commit
da2706b28f
2 changed files with 5 additions and 1 deletions
|
|
@ -6724,7 +6724,7 @@ device_encoding(PyObject *self, PyObject *args)
|
|||
#elif defined(CODESET)
|
||||
{
|
||||
char *codeset = nl_langinfo(CODESET);
|
||||
if (codeset)
|
||||
if (codeset != NULL && codeset[0] != 0)
|
||||
return PyUnicode_FromString(codeset);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue