Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7611964

Browse files
committed
Fix test_bytes when sys.stdin is None, for example on Windows when using
pythonw.exe instead of python.exe
1 parent 42d3bde commit 7611964

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/test/test_bytes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ class BytesTest(BaseBytesTest, unittest.TestCase):
700700
type2test = bytes
701701

702702
def test_buffer_is_readonly(self):
703-
fd = os.dup(sys.stdin.fileno())
703+
fd = os.open(__file__, os.O_RDONLY)
704704
with open(fd, "rb", buffering=0) as f:
705705
self.assertRaises(TypeError, f.readinto, b"")
706706

0 commit comments

Comments
 (0)