summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-06-20 14:10:47 (GMT)
committerGitHub <noreply@github.com>2022-06-20 14:10:47 (GMT)
commitcfb986a1a239f1a00af745a53235b8473b1bd54a (patch)
tree275b131dcd4df8d0b1d3a312910d4c7f01f2c545 /Parser
parent7ad6f74fcf9db1ccfeaf0986064870d8d3887300 (diff)
downloadcpython-cfb986a1a239f1a00af745a53235b8473b1bd54a.zip
cpython-cfb986a1a239f1a00af745a53235b8473b1bd54a.tar.gz
cpython-cfb986a1a239f1a00af745a53235b8473b1bd54a.tar.bz2
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().
Diffstat (limited to 'Parser')
-rw-r--r--Parser/myreadline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index b10d306..d55fcef 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -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));