mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
SF bug 924242: socket._fileobject._getclosed() returns wrong value
The .closed property always returned the wrong result. Bugfix candidate!
This commit is contained in:
parent
165163f245
commit
116d83ce71
2 changed files with 9 additions and 1 deletions
|
@ -590,6 +590,7 @@ class FileObjectClassTestCase(SocketConnectedTest):
|
|||
|
||||
def tearDown(self):
|
||||
self.serv_file.close()
|
||||
self.assert_(self.serv_file.closed)
|
||||
self.serv_file = None
|
||||
SocketConnectedTest.tearDown(self)
|
||||
|
||||
|
@ -599,6 +600,7 @@ class FileObjectClassTestCase(SocketConnectedTest):
|
|||
|
||||
def clientTearDown(self):
|
||||
self.cli_file.close()
|
||||
self.assert_(self.cli_file.closed)
|
||||
self.cli_file = None
|
||||
SocketConnectedTest.clientTearDown(self)
|
||||
|
||||
|
@ -645,6 +647,12 @@ class FileObjectClassTestCase(SocketConnectedTest):
|
|||
self.cli_file.write(MSG)
|
||||
self.cli_file.flush()
|
||||
|
||||
def testClosedAttr(self):
|
||||
self.assert_(not self.serv_file.closed)
|
||||
|
||||
def _testClosedAttr(self):
|
||||
self.assert_(not self.cli_file.closed)
|
||||
|
||||
class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase):
|
||||
|
||||
"""Repeat the tests from FileObjectClassTestCase with bufsize==0.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue