diff options
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 4c8c7d666a..8f96fe48a3 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -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): |