summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-04-05 09:44:04 (GMT)
committerGitHub <noreply@github.com>2019-04-05 09:44:04 (GMT)
commit6a8c3139ae9ada89d4a95985ec7cf8bb7d03bc01 (patch)
tree2a1dc09669a70347b6eff0ae493e774d042903f7 /Python
parent176d26364bb67801fa522f52f20cbe44420d6942 (diff)
downloadcpython-6a8c3139ae9ada89d4a95985ec7cf8bb7d03bc01.zip
cpython-6a8c3139ae9ada89d4a95985ec7cf8bb7d03bc01.tar.gz
cpython-6a8c3139ae9ada89d4a95985ec7cf8bb7d03bc01.tar.bz2
bpo-36301: Fix _PyPreConfig_Read() compiler warning (GH-12695)
Initialize init_utf8_mode earlier to fix a compiler warning.
Diffstat (limited to 'Python')
-rw-r--r--Python/preconfig.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/preconfig.c b/Python/preconfig.c
index 7ac645d..78377cf 100644
--- a/Python/preconfig.c
+++ b/Python/preconfig.c
@@ -720,6 +720,11 @@ _PyPreConfig_Read(_PyPreConfig *config, const _PyArgv *args)
_Py_SetLocaleFromEnv(LC_CTYPE);
_PyPreCmdline cmdline = _PyPreCmdline_INIT;
+ int init_utf8_mode = Py_UTF8Mode;
+#ifdef MS_WINDOWS
+ int init_legacy_encoding = Py_LegacyWindowsFSEncodingFlag;
+#endif
+
if (args) {
err = _PyPreCmdline_SetArgv(&cmdline, args);
if (_Py_INIT_FAILED(err)) {
@@ -727,10 +732,6 @@ _PyPreConfig_Read(_PyPreConfig *config, const _PyArgv *args)
}
}
- int init_utf8_mode = Py_UTF8Mode;
-#ifdef MS_WINDOWS
- int init_legacy_encoding = Py_LegacyWindowsFSEncodingFlag;
-#endif
int locale_coerced = 0;
int loops = 0;