summaryrefslogtreecommitdiffstats
path: root/Python/fileutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r--Python/fileutils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index a38886a..7e5d01f 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -603,9 +603,9 @@ _Py_DecodeLocaleEx(const char* arg, wchar_t **wstr, size_t *wlen,
return _Py_DecodeUTF8Ex(arg, strlen(arg), wstr, wlen, reason,
errors);
#else
- int use_utf8 = (Py_UTF8Mode == 1);
+ int use_utf8 = (_PyRuntime.preconfig.utf8_mode >= 1);
#ifdef MS_WINDOWS
- use_utf8 |= !Py_LegacyWindowsFSEncodingFlag;
+ use_utf8 |= (_PyRuntime.preconfig.legacy_windows_fs_encoding == 0);
#endif
if (use_utf8) {
return _Py_DecodeUTF8Ex(arg, strlen(arg), wstr, wlen, reason,
@@ -795,9 +795,9 @@ encode_locale_ex(const wchar_t *text, char **str, size_t *error_pos,
return _Py_EncodeUTF8Ex(text, str, error_pos, reason,
raw_malloc, errors);
#else
- int use_utf8 = (Py_UTF8Mode == 1);
+ int use_utf8 = (_PyRuntime.preconfig.utf8_mode >= 1);
#ifdef MS_WINDOWS
- use_utf8 |= !Py_LegacyWindowsFSEncodingFlag;
+ use_utf8 |= (_PyRuntime.preconfig.legacy_windows_fs_encoding == 0);
#endif
if (use_utf8) {
return _Py_EncodeUTF8Ex(text, str, error_pos, reason,