Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f810767

Browse files
committed
Issue #22854: Merge Windows pipe skipping from 3.5
2 parents c0aab1d + 0950e6a commit f810767

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Lib/test/test_io.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,6 @@ class UnseekableWriter(self.MockUnseekableIO):
424424
self.assertEqual(obj.readable(), readable)
425425
writable = "w" in abilities
426426
self.assertEqual(obj.writable(), writable)
427-
seekable = "s" in abilities
428-
429-
# Detection of pipes being non-seekable does not seem to work
430-
# on Windows
431-
if not sys.platform.startswith("win") or test not in (
432-
pipe_reader, pipe_writer):
433-
self.assertEqual(obj.seekable(), seekable)
434427

435428
if isinstance(obj, self.TextIOBase):
436429
data = "3"
@@ -456,6 +449,13 @@ class UnseekableWriter(self.MockUnseekableIO):
456449
else:
457450
self.assertRaises(OSError, obj.write, data)
458451

452+
if sys.platform.startswith("win") or test in (
453+
pipe_reader, pipe_writer):
454+
# Pipes seem to appear as seekable on Windows
455+
continue
456+
seekable = "s" in abilities
457+
self.assertEqual(obj.seekable(), seekable)
458+
459459
if seekable:
460460
obj.tell()
461461
obj.seek(0)

0 commit comments

Comments
 (0)