Skip to content

Commit 2935e65

Browse files
authored
bpo-40275: Fix name error in support.socket_helper (GH-19825)
Replace TestFailed with support.TestFailed. Bug spotted by pyflakes.
1 parent 17014e4 commit 2935e65

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Lib/test/support/socket_helper.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,15 @@ def bind_port(sock, host=HOST):
9191
if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM:
9292
if hasattr(socket, 'SO_REUSEADDR'):
9393
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
94-
raise TestFailed("tests should never set the SO_REUSEADDR " \
95-
"socket option on TCP/IP sockets!")
94+
raise support.TestFailed("tests should never set the "
95+
"SO_REUSEADDR socket option on "
96+
"TCP/IP sockets!")
9697
if hasattr(socket, 'SO_REUSEPORT'):
9798
try:
9899
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
99-
raise TestFailed("tests should never set the SO_REUSEPORT " \
100-
"socket option on TCP/IP sockets!")
100+
raise support.TestFailed("tests should never set the "
101+
"SO_REUSEPORT socket option on "
102+
"TCP/IP sockets!")
101103
except OSError:
102104
# Python's socket module was compiled using modern headers
103105
# thus defining SO_REUSEPORT but this process is running

0 commit comments

Comments
 (0)