mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #10819: SocketIO.name property returns -1 when its closed, instead of
raising a ValueError, to fix repr().
This commit is contained in:
parent
8848c7a37f
commit
c3a51ecb85
3 changed files with 13 additions and 1 deletions
|
@ -738,6 +738,12 @@ class GeneralModuleTests(unittest.TestCase):
|
|||
f = None
|
||||
support.gc_collect()
|
||||
|
||||
def test_name_closed_socketio(self):
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
||||
fp = sock.makefile("rb")
|
||||
fp.close()
|
||||
self.assertEqual(repr(fp), "<_io.BufferedReader name=-1>")
|
||||
|
||||
|
||||
@unittest.skipUnless(thread, 'Threading required for this test.')
|
||||
class BasicTCPTest(SocketConnectedTest):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue