Skip to content

Commit 6a8c313

Browse files
authored
bpo-36301: Fix _PyPreConfig_Read() compiler warning (GH-12695)
Initialize init_utf8_mode earlier to fix a compiler warning.
1 parent 176d263 commit 6a8c313

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎Python/preconfig.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -720,17 +720,18 @@ _PyPreConfig_Read(_PyPreConfig *config, const _PyArgv *args)
720720
_Py_SetLocaleFromEnv(LC_CTYPE);
721721

722722
_PyPreCmdline cmdline = _PyPreCmdline_INIT;
723+
int init_utf8_mode = Py_UTF8Mode;
724+
#ifdef MS_WINDOWS
725+
int init_legacy_encoding = Py_LegacyWindowsFSEncodingFlag;
726+
#endif
727+
723728
if (args) {
724729
err = _PyPreCmdline_SetArgv(&cmdline, args);
725730
if (_Py_INIT_FAILED(err)) {
726731
goto done;
727732
}
728733
}
729734

730-
int init_utf8_mode = Py_UTF8Mode;
731-
#ifdef MS_WINDOWS
732-
int init_legacy_encoding = Py_LegacyWindowsFSEncodingFlag;
733-
#endif
734735
int locale_coerced = 0;
735736
int loops = 0;
736737

0 commit comments

Comments
 (0)