Skip to content

Commit 5638d29

Browse files
nielsbuwensrittau
authored andcommitted
Fix #3187 : Wrong Signatures in socketserver (#3189)
Fixes #3187
1 parent 0ee7c3c commit 5638d29

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

stdlib/2/SocketServer.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NB: SocketServer.pyi and socketserver.pyi must remain consistent!
22
# Stubs for socketserver
33

4-
from typing import Any, BinaryIO, Optional, Tuple, Type
4+
from typing import Any, BinaryIO, Optional, Tuple, Type, Text, Union
55
from socket import SocketType
66
import sys
77
import types
@@ -15,7 +15,7 @@ class BaseServer:
1515
request_queue_size: int
1616
socket_type: int
1717
timeout: Optional[float]
18-
def __init__(self, server_address: Tuple[str, int],
18+
def __init__(self, server_address: Any,
1919
RequestHandlerClass: type) -> None: ...
2020
def fileno(self) -> int: ...
2121
def handle_request(self) -> None: ...
@@ -54,12 +54,12 @@ class UDPServer(BaseServer):
5454

5555
if sys.platform != 'win32':
5656
class UnixStreamServer(BaseServer):
57-
def __init__(self, server_address: Tuple[str, int],
57+
def __init__(self, server_address: Union[Text, bytes],
5858
RequestHandlerClass: type,
5959
bind_and_activate: bool = ...) -> None: ...
6060

6161
class UnixDatagramServer(BaseServer):
62-
def __init__(self, server_address: Tuple[str, int],
62+
def __init__(self, server_address: Union[Text, bytes],
6363
RequestHandlerClass: type,
6464
bind_and_activate: bool = ...) -> None: ...
6565

stdlib/3/socketserver.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NB: SocketServer.pyi and socketserver.pyi must remain consistent!
22
# Stubs for socketserver
33

4-
from typing import Any, BinaryIO, Optional, Tuple, Type
4+
from typing import Any, BinaryIO, Optional, Tuple, Type, Text, Union
55
from socket import SocketType
66
import sys
77
import types
@@ -15,7 +15,7 @@ class BaseServer:
1515
request_queue_size: int
1616
socket_type: int
1717
timeout: Optional[float]
18-
def __init__(self, server_address: Tuple[str, int],
18+
def __init__(self, server_address: Any,
1919
RequestHandlerClass: type) -> None: ...
2020
def fileno(self) -> int: ...
2121
def handle_request(self) -> None: ...
@@ -54,12 +54,12 @@ class UDPServer(BaseServer):
5454

5555
if sys.platform != 'win32':
5656
class UnixStreamServer(BaseServer):
57-
def __init__(self, server_address: Tuple[str, int],
57+
def __init__(self, server_address: Union[Text, bytes],
5858
RequestHandlerClass: type,
5959
bind_and_activate: bool = ...) -> None: ...
6060

6161
class UnixDatagramServer(BaseServer):
62-
def __init__(self, server_address: Tuple[str, int],
62+
def __init__(self, server_address: Union[Text, bytes],
6363
RequestHandlerClass: type,
6464
bind_and_activate: bool = ...) -> None: ...
6565

0 commit comments

Comments
 (0)