Fix test_bytes when sys.stdin is None, for example on Windows when using
pythonw.exe instead of python.exe
This commit is contained in:
parent
42d3bdeed6
commit
7611964b2c
|
@ -700,7 +700,7 @@ class BytesTest(BaseBytesTest, unittest.TestCase):
|
||||||
type2test = bytes
|
type2test = bytes
|
||||||
|
|
||||||
def test_buffer_is_readonly(self):
|
def test_buffer_is_readonly(self):
|
||||||
fd = os.dup(sys.stdin.fileno())
|
fd = os.open(__file__, os.O_RDONLY)
|
||||||
with open(fd, "rb", buffering=0) as f:
|
with open(fd, "rb", buffering=0) as f:
|
||||||
self.assertRaises(TypeError, f.readinto, b"")
|
self.assertRaises(TypeError, f.readinto, b"")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue