summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_bytes.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 230dbf4..c64ac19 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -454,7 +454,8 @@ class BytesTest(BaseBytesTest):
type2test = bytes
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"")