[Python-checkins] cpython (3.6): Issue #28471: Avoid ResourceWarning by detaching test socket

martin.panter python-checkins at python.org
Thu Oct 20 19:08:58 EDT 2016


https://hg.python.org/cpython/rev/2fd92794f775
changeset: 104594:2fd92794f775
branch: 3.6
parent: 104592:03528baa8c2c
user: Martin Panter <vadmium+py at gmail.com>
date: Thu Oct 20 07:44:29 2016 +0000
summary:
 Issue #28471: Avoid ResourceWarning by detaching test socket
files:
 Lib/test/test_socket.py | 1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4559,6 +4559,7 @@
 sock = socket.socket(
 socket.AF_INET, socket.SOCK_STREAM, 0, sock0.fileno())
 sock0.close()
+ self.addCleanup(sock.detach)
 
 with self.assertRaises(OSError):
 sock.setblocking(False)
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /