]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40275: Fix name error in support.socket_helper (GH-19825)
authorVictor Stinner <vstinner@python.org>
Fri, 1 May 2020 00:35:24 +0000 (02:35 +0200)
committerGitHub <noreply@github.com>
Fri, 1 May 2020 00:35:24 +0000 (02:35 +0200)
Replace TestFailed with support.TestFailed.

Bug spotted by pyflakes.

Lib/test/support/socket_helper.py

index 0ac844556292634c2bf2de507a3e642624912656..f709ffd40dd8a38cba8ea8ba1325e17e8c739d17 100644 (file)
@@ -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