Issue #22854: Merge Windows pipe skipping from 3.5
This commit is contained in:
commit
f810767bd3
|
@ -424,13 +424,6 @@ class IOTest(unittest.TestCase):
|
||||||
self.assertEqual(obj.readable(), readable)
|
self.assertEqual(obj.readable(), readable)
|
||||||
writable = "w" in abilities
|
writable = "w" in abilities
|
||||||
self.assertEqual(obj.writable(), writable)
|
self.assertEqual(obj.writable(), writable)
|
||||||
seekable = "s" in abilities
|
|
||||||
|
|
||||||
# Detection of pipes being non-seekable does not seem to work
|
|
||||||
# on Windows
|
|
||||||
if not sys.platform.startswith("win") or test not in (
|
|
||||||
pipe_reader, pipe_writer):
|
|
||||||
self.assertEqual(obj.seekable(), seekable)
|
|
||||||
|
|
||||||
if isinstance(obj, self.TextIOBase):
|
if isinstance(obj, self.TextIOBase):
|
||||||
data = "3"
|
data = "3"
|
||||||
|
@ -456,6 +449,13 @@ class IOTest(unittest.TestCase):
|
||||||
else:
|
else:
|
||||||
self.assertRaises(OSError, obj.write, data)
|
self.assertRaises(OSError, obj.write, data)
|
||||||
|
|
||||||
|
if sys.platform.startswith("win") or test in (
|
||||||
|
pipe_reader, pipe_writer):
|
||||||
|
# Pipes seem to appear as seekable on Windows
|
||||||
|
continue
|
||||||
|
seekable = "s" in abilities
|
||||||
|
self.assertEqual(obj.seekable(), seekable)
|
||||||
|
|
||||||
if seekable:
|
if seekable:
|
||||||
obj.tell()
|
obj.tell()
|
||||||
obj.seek(0)
|
obj.seek(0)
|
||||||
|
|
Loading…
Reference in New Issue