Skip to content

Commit 8ee7294

Browse files
committed
Skip if there is no real console handle
1 parent 63105a2 commit 8ee7294

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_cmd_line.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Most tests are executed with environment variables ignored
33
# See test_cmd_line_script.py for testing of script execution
44

5+
import io
56
import os
67
import subprocess
78
import sys
@@ -971,6 +972,8 @@ def test_python_legacy_windows_fs_encoding(self):
971972
self.assertIn(expected.encode(), out)
972973

973974
@unittest.skipUnless(support.MS_WINDOWS, 'Test only applicable on Windows')
975+
@unittest.skipUnless(type(sys.stdin.buffer.raw) == io._WindowsConsoleIO,
976+
'Requires real console handles')
974977
def test_python_legacy_windows_stdio(self):
975978
code = "import sys; print(sys.stdin.encoding, sys.stdout.encoding, file=sys.stderr)"
976979
env = os.environ.copy()

0 commit comments

Comments
 (0)