From: Benjamin Peterson Date: Wed, 24 Dec 2008 15:10:27 +0000 (+0000) Subject: #4736 BufferRWPair.closed shouldn't try to call another property as a function X-Git-Tag: v2.7a1~2501 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54686e3c2981a18521db088ffc16d5f4e5983e75;p=thirdparty%2FPython%2Fcpython.git #4736 BufferRWPair.closed shouldn't try to call another property as a function --- diff --git a/Lib/io.py b/Lib/io.py index 7f938987b712..320a4b9b5f23 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 8a7da60947b0..967018ea453a 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 775392437c06..026e4781d701 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.