From 54686e3c2981a18521db088ffc16d5f4e5983e75 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 24 Dec 2008 15:10:27 +0000 Subject: #4736 BufferRWPair.closed shouldn't try to call another property as a function --- Lib/io.py | 2 +- Lib/test/test_io.py | 3 ++- Misc/NEWS | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/io.py b/Lib/io.py index 7f93898..320a4b9 100644 --- a/Lib/io.py +++ b/Lib/io.py @@ -1167,7 +1167,7 @@ class BufferedRWPair(BufferedIOBase): @property def closed(self): - return self.writer.closed() + return self.writer.closed class BufferedRandom(BufferedWriter, BufferedReader): diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 8a7da60..967018e 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -554,8 +554,9 @@ class BufferedRWPairTest(unittest.TestCase): r = MockRawIO(()) w = MockRawIO() pair = io.BufferedRWPair(r, w) + self.assertFalse(pair.closed) - # XXX need implementation + # XXX More Tests class BufferedRandomTest(unittest.TestCase): diff --git a/Misc/NEWS b/Misc/NEWS index 7753924..026e478 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -86,6 +86,8 @@ Core and Builtins Library ------- +- Issue #4736: io.BufferedRWPair's closed property now functions properly. + - Issue #3954: Fix a potential SystemError in _hotshot.logreader error handling. -- cgit v0.12