mirror of https://github.com/python/cpython
(Merge 3.4) 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:
commit
d6af04780a
|
@ -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