Issue #3571: test_bytes mistakingly closed stdin

This commit is contained in:
Antoine Pitrou 2008-08-16 23:28:44 +00:00
parent b9ee06c26b
commit 47d305d689
1 changed files with 2 additions and 1 deletions

View File

@ -454,7 +454,8 @@ class BytesTest(BaseBytesTest):
type2test = bytes type2test = bytes
def test_buffer_is_readonly(self): def test_buffer_is_readonly(self):
with open(sys.stdin.fileno(), "rb", buffering=0) as f: fd = os.dup(sys.stdin.fileno())
with open(fd, "rb", buffering=0) as f:
self.assertRaises(TypeError, f.readinto, b"") self.assertRaises(TypeError, f.readinto, b"")