1
1
# NB: SocketServer.pyi and socketserver.pyi must remain consistent!
2
2
# Stubs for socketserver
3
3
4
- from typing import Any , BinaryIO , Optional , Tuple , Type
4
+ from typing import Any , BinaryIO , Optional , Tuple , Type , Text , Union
5
5
from socket import SocketType
6
6
import sys
7
7
import types
@@ -15,7 +15,7 @@ class BaseServer:
15
15
request_queue_size : int
16
16
socket_type : int
17
17
timeout : Optional [float ]
18
- def __init__ (self , server_address : Tuple [ str , int ] ,
18
+ def __init__ (self , server_address : Any ,
19
19
RequestHandlerClass : type ) -> None : ...
20
20
def fileno (self ) -> int : ...
21
21
def handle_request (self ) -> None : ...
@@ -54,12 +54,12 @@ class UDPServer(BaseServer):
54
54
55
55
if sys .platform != 'win32' :
56
56
class UnixStreamServer (BaseServer ):
57
- def __init__ (self , server_address : Tuple [ str , int ],
57
+ def __init__ (self , server_address : Union [ Text , bytes ],
58
58
RequestHandlerClass : type ,
59
59
bind_and_activate : bool = ...) -> None : ...
60
60
61
61
class UnixDatagramServer (BaseServer ):
62
- def __init__ (self , server_address : Tuple [ str , int ],
62
+ def __init__ (self , server_address : Union [ Text , bytes ],
63
63
RequestHandlerClass : type ,
64
64
bind_and_activate : bool = ...) -> None : ...
65
65
0 commit comments