diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-05-02 11:28:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-02 11:28:57 -0400 |
commit | e251095a3f4778102f554cecffcfd837f4d1db6c (patch) | |
tree | 050ebaae241e689f989f42cf3d8bbe23d6f9258b /Python/pylifecycle.c | |
parent | c4e78b116f9a4299f3b3bfbbd18ef49782bb1143 (diff) | |
download | cpython-git-e251095a3f4778102f554cecffcfd837f4d1db6c.tar.gz |
bpo-36775: Add _Py_FORCE_UTF8_FS_ENCODING macro (GH-13056)
Add _Py_FORCE_UTF8_LOCALE and _Py_FORCE_UTF8_FS_ENCODING macros to
avoid factorize "#if defined(__ANDROID__) || defined(__VXWORKS__)"
and "#if defined(__APPLE__)".
Cleanup also config_init_fs_encoding().
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index afa683b7e8..40eeebdd1a 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -366,8 +366,7 @@ _Py_CoerceLegacyLocale(int warn) const char *new_locale = setlocale(LC_CTYPE, target->locale_name); if (new_locale != NULL) { -#if !defined(__APPLE__) && !defined(__ANDROID__) && \ -defined(HAVE_LANGINFO_H) && defined(CODESET) +#if !defined(_Py_FORCE_UTF8_LOCALE) && defined(HAVE_LANGINFO_H) && defined(CODESET) /* Also ensure that nl_langinfo works in this locale */ char *codeset = nl_langinfo(CODESET); if (!codeset || *codeset == '\0') { |