]> granicus.if.org Git - python/commitdiff
Fix test_bytes when sys.stdin is None, for example on Windows when using
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 28 Jul 2014 20:07:07 +0000 (22:07 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 28 Jul 2014 20:07:07 +0000 (22:07 +0200)
pythonw.exe instead of python.exe

Lib/test/test_bytes.py

index f350211f713aa504fe9c71744a17fc5e7c3e5656..43b6c824a8383a33567b734c9434d8895e9d795f 100644 (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"")