|
29 | 29 |
|
30 | 30 | _Connection = typing.TypeVar('_Connection')
|
31 | 31 | _Protocol = typing.TypeVar('_Protocol', bound=asyncio.Protocol)
|
| 32 | +_Record = typing.TypeVar('_Record', bound=protocol.Record) |
32 | 33 |
|
33 | 34 | _TPTupleType = typing.Tuple[asyncio.WriteTransport, _Protocol]
|
34 | 35 | AddrType = typing.Union[typing.Tuple[str, int], str]
|
@@ -654,7 +655,7 @@ async def _connect_addr(
|
654 | 655 | params: _ConnectionParameters,
|
655 | 656 | config: _ClientConfiguration,
|
656 | 657 | connection_class: typing.Type[_Connection],
|
657 |
| -record_class: typing.Any |
| 658 | +record_class: typing.Type[_Record] |
658 | 659 | ) -> _Connection:
|
659 | 660 | assert loop is not None
|
660 | 661 |
|
@@ -680,7 +681,7 @@ async def _connect_addr(
|
680 | 681 | assert not params.ssl
|
681 | 682 | connector = typing.cast(
|
682 | 683 | typing.Coroutine[typing.Any, None,
|
683 |
| -_TPTupleType[protocol.Protocol]], |
| 684 | +_TPTupleType['protocol.Protocol[_Record]']], |
684 | 685 | loop.create_unix_connection(proto_factory, addr))
|
685 | 686 | elif params.ssl:
|
686 | 687 | connector = _create_ssl_connection(
|
@@ -689,7 +690,7 @@ async def _connect_addr(
|
689 | 690 | else:
|
690 | 691 | connector = typing.cast(
|
691 | 692 | typing.Coroutine[typing.Any, None,
|
692 |
| -_TPTupleType[protocol.Protocol]], |
| 693 | +_TPTupleType['protocol.Protocol[_Record]']], |
693 | 694 | loop.create_connection(proto_factory, *addr))
|
694 | 695 |
|
695 | 696 | connector_future = asyncio.ensure_future(connector)
|
@@ -721,7 +722,7 @@ async def _connect(
|
721 | 722 | loop: typing.Optional[asyncio.AbstractEventLoop],
|
722 | 723 | timeout: float,
|
723 | 724 | connection_class: typing.Type[_Connection],
|
724 |
| -record_class: typing.Any, |
| 725 | +record_class: typing.Type[_Record], |
725 | 726 | **kwargs: typing.Any
|
726 | 727 | ) -> _Connection:
|
727 | 728 | if loop is None:
|
|
0 commit comments