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:
Victor Stinner 2014-07-28 22:07:07 +02:00
parent 42d3bdeed6
commit 7611964b2c
1 changed files with 1 additions and 1 deletions

View File

@ -700,7 +700,7 @@ class BytesTest(BaseBytesTest, unittest.TestCase):
type2test = bytes
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:
self.assertRaises(TypeError, f.readinto, b"")