summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-05-01 00:35:24 (GMT)
committerGitHub <noreply@github.com>2020-05-01 00:35:24 (GMT)
commit2935e65c36fab1989bbda19db72c035ea22b044b (patch)
tree67bdebd763905e5e1167b349656d540b0474910a /Lib/test
parent17014e45864cefd37660b054fb71fa2e177690ef (diff)
downloadcpython-2935e65c36fab1989bbda19db72c035ea22b044b.zip
cpython-2935e65c36fab1989bbda19db72c035ea22b044b.tar.gz
cpython-2935e65c36fab1989bbda19db72c035ea22b044b.tar.bz2
bpo-40275: Fix name error in support.socket_helper (GH-19825)
Replace TestFailed with support.TestFailed. Bug spotted by pyflakes.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/support/socket_helper.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/support/socket_helper.py b/Lib/test/support/socket_helper.py
index 0ac8445..f709ffd 100644
--- a/Lib/test/support/socket_helper.py
+++ b/Lib/test/support/socket_helper.py
@@ -91,13 +91,15 @@ def bind_port(sock, host=HOST):
if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM:
if hasattr(socket, 'SO_REUSEADDR'):
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
- raise TestFailed("tests should never set the SO_REUSEADDR " \
- "socket option on TCP/IP sockets!")
+ raise support.TestFailed("tests should never set the "
+ "SO_REUSEADDR socket option on "
+ "TCP/IP sockets!")
if hasattr(socket, 'SO_REUSEPORT'):
try:
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
- raise TestFailed("tests should never set the SO_REUSEPORT " \
- "socket option on TCP/IP sockets!")
+ raise support.TestFailed("tests should never set the "
+ "SO_REUSEPORT socket option on "
+ "TCP/IP sockets!")
except OSError:
# Python's socket module was compiled using modern headers
# thus defining SO_REUSEPORT but this process is running