|
9 | 9 | import enum |
10 | 10 | import functools |
11 | 11 | import getpass |
| 12 | +import inspect |
12 | 13 | import os |
13 | 14 | import pathlib |
14 | 15 | import platform |
@@ -268,7 +269,9 @@ def _parse_hostlist(hostlist: str, |
268 | 269 | hostspec_port = urllib.parse.unquote(hostspec_port) |
269 | 270 | hostlist_ports.append(int(hostspec_port)) |
270 | 271 | else: |
271 | | - hostlist_ports.append(default_port[i]) |
| 272 | + hostlist_ports.append( |
| 273 | + default_port[i] # pyright: ignore [reportUnknownArgumentType, reportUnboundVariable] # noqa: E501 |
| 274 | + ) |
272 | 275 |
|
273 | 276 | if not ports: |
274 | 277 | ports = hostlist_ports |
@@ -892,7 +895,7 @@ async def _connect_addr( |
892 | 895 | if inspect.isawaitable(password): |
893 | 896 | password = await password |
894 | 897 |
|
895 | | - params = params._replace(password=password) |
| 898 | + params = params._replace(password=typing.cast(str, password)) |
896 | 899 | args = (addr, loop, config, connection_class, record_class, params_input) |
897 | 900 |
|
898 | 901 | # prepare the params (which attempt has ssl) for the 2 attempts |
@@ -954,8 +957,13 @@ async def __connect_addr( |
954 | 957 | elif params.ssl and params.direct_tls: |
955 | 958 | # if ssl and direct_tls are given, skip STARTTLS and perform direct |
956 | 959 | # SSL connection |
957 | | - connector = loop.create_connection( |
958 | | - proto_factory, *addr, ssl=params.ssl |
| 960 | + connector = typing.cast( |
| 961 | + typing.Coroutine[ |
| 962 | + typing.Any, None, _TPTupleType['protocol.Protocol[_Record]'] |
| 963 | + ], |
| 964 | + loop.create_connection( |
| 965 | + proto_factory, *addr, ssl=params.ssl |
| 966 | + ) |
959 | 967 | ) |
960 | 968 |
|
961 | 969 | elif params.ssl: |
|
0 commit comments