summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kloth <jeremy.kloth@gmail.com>2021-10-05 12:17:13 (GMT)
committerGitHub <noreply@github.com>2021-10-05 12:17:13 (GMT)
commitde4052fe0633e3a053e66c8477f13677054d6ede (patch)
tree53c7298731a34a2cd92c7c3a1b97b77a50bec92b
parent0af08f343a7b792f527b78e2a35d9453039940c2 (diff)
downloadcpython-de4052fe0633e3a053e66c8477f13677054d6ede.zip
cpython-de4052fe0633e3a053e66c8477f13677054d6ede.tar.gz
cpython-de4052fe0633e3a053e66c8477f13677054d6ede.tar.bz2
bpo-45354: Skip obsolete device name tests on Windows 11 (GH-28712)
-rw-r--r--Lib/test/test_winconsoleio.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/test/test_winconsoleio.py b/Lib/test/test_winconsoleio.py
index 1807e47..70a8555 100644
--- a/Lib/test/test_winconsoleio.py
+++ b/Lib/test/test_winconsoleio.py
@@ -92,9 +92,11 @@ class WindowsConsoleIOTests(unittest.TestCase):
f.close()
f.close()
- f = open('C:/con', 'rb', buffering=0)
- self.assertIsInstance(f, ConIO)
- f.close()
+ # bpo-45354: Windows 11 changed MS-DOS device name handling
+ if sys.getwindowsversion()[:3] < (10, 0, 22000):
+ f = open('C:/con', 'rb', buffering=0)
+ self.assertIsInstance(f, ConIO)
+ f.close()
@unittest.skipIf(sys.getwindowsversion()[:2] <= (6, 1),
"test does not work on Windows 7 and earlier")
@@ -114,7 +116,8 @@ class WindowsConsoleIOTests(unittest.TestCase):
conout_path = os.path.join(temp_path, 'CONOUT$')
with open(conout_path, 'wb', buffering=0) as f:
- if sys.getwindowsversion()[:2] > (6, 1):
+ # bpo-45354: Windows 11 changed MS-DOS device name handling
+ if (6, 1) < sys.getwindowsversion()[:3] < (10, 0, 22000):
self.assertIsInstance(f, ConIO)
else:
self.assertNotIsInstance(f, ConIO)