diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-07-28 22:07:07 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-07-28 22:07:07 +0200 |
commit | 7611964b2cb82e38f3354e665bbe6c9e7efa8cb6 (patch) | |
tree | ecb38bd1c179231c7eabce59b8b18067f52bb2b6 /Lib/test/test_bytes.py | |
parent | 42d3bdeed6e34117b787d61a471563a0dba6a894 (diff) | |
download | cpython-git-7611964b2cb82e38f3354e665bbe6c9e7efa8cb6.tar.gz |
Fix test_bytes when sys.stdin is None, for example on Windows when using
pythonw.exe instead of python.exe
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r-- | Lib/test/test_bytes.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index f350211f71..43b6c824a8 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -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"") |