mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	bpo-40275: Fix name error in support.socket_helper (GH-19825)
Replace TestFailed with support.TestFailed. Bug spotted by pyflakes.
This commit is contained in:
		
							parent
							
								
									17014e4586
								
							
						
					
					
						commit
						2935e65c36
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		|  | @ -91,13 +91,15 @@ def bind_port(sock, host=HOST): | ||||||
|     if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM: |     if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM: | ||||||
|         if hasattr(socket, 'SO_REUSEADDR'): |         if hasattr(socket, 'SO_REUSEADDR'): | ||||||
|             if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1: |             if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1: | ||||||
|                 raise TestFailed("tests should never set the SO_REUSEADDR "   \ |                 raise support.TestFailed("tests should never set the " | ||||||
|                                  "socket option on TCP/IP sockets!") |                                          "SO_REUSEADDR socket option on " | ||||||
|  |                                          "TCP/IP sockets!") | ||||||
|         if hasattr(socket, 'SO_REUSEPORT'): |         if hasattr(socket, 'SO_REUSEPORT'): | ||||||
|             try: |             try: | ||||||
|                 if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: |                 if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: | ||||||
|                     raise TestFailed("tests should never set the SO_REUSEPORT "   \ |                     raise support.TestFailed("tests should never set the " | ||||||
|                                      "socket option on TCP/IP sockets!") |                                              "SO_REUSEPORT socket option on " | ||||||
|  |                                              "TCP/IP sockets!") | ||||||
|             except OSError: |             except OSError: | ||||||
|                 # Python's socket module was compiled using modern headers |                 # Python's socket module was compiled using modern headers | ||||||
|                 # thus defining SO_REUSEPORT but this process is running |                 # thus defining SO_REUSEPORT but this process is running | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner