mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-93937: PyOS_StdioReadline() uses PyConfig.legacy_windows_stdio (#94024)
On Windows, PyOS_StdioReadline() now gets PyConfig.legacy_windows_stdio from _PyOS_ReadlineTState, rather than using the deprecated global Py_LegacyWindowsStdioFlag variable. Fix also a compiler warning in Py_SetStandardStreamEncoding().
This commit is contained in:
parent
7ad6f74fcf
commit
cfb986a1a2
2 changed files with 5 additions and 1 deletions
|
@ -247,7 +247,8 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
|
|||
assert(tstate != NULL);
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
if (!Py_LegacyWindowsStdioFlag && sys_stdin == stdin) {
|
||||
const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp);
|
||||
if (!config->legacy_windows_stdio && sys_stdin == stdin) {
|
||||
HANDLE hStdIn, hStdErr;
|
||||
|
||||
hStdIn = _Py_get_osfhandle_noraise(fileno(sys_stdin));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue