|
4 | 4 | import socket |
5 | 5 | import typing |
6 | 6 | import warnings |
| 7 | +from collections.abc import Sequence |
7 | 8 | from errno import errorcode |
8 | 9 | from functools import partial, wraps |
9 | 10 | from itertools import chain, count |
10 | 11 | from sys import platform |
11 | | -from typing import Any, Callable, List, Optional, Sequence, TypeVar |
| 12 | +from typing import Any, Callable, Optional, TypeVar |
12 | 13 | from weakref import WeakValueDictionary |
13 | 14 |
|
14 | 15 | from cryptography import x509 |
@@ -288,7 +289,7 @@ class _NoOverlappingProtocols: |
288 | 289 | _ALPNSelectCallback = Callable[ |
289 | 290 | [ |
290 | 291 | "Connection", |
291 | | - typing.Union[List[bytes], _NoOverlappingProtocols], |
| 292 | + typing.Union[typing.List[bytes], _NoOverlappingProtocols], |
292 | 293 | ], |
293 | 294 | None, |
294 | 295 | ] |
@@ -766,7 +767,7 @@ def _asFileDescriptor(obj: Any) -> int: |
766 | 767 | raise TypeError("argument must be an int, or have a fileno() method.") |
767 | 768 | elif fd < 0: |
768 | 769 | raise ValueError( |
769 | | - "file descriptor cannot be a negative integer (%i)" % (fd,) |
| 770 | + f"file descriptor cannot be a negative integer ({fd:i})" |
770 | 771 | ) |
771 | 772 |
|
772 | 773 | return fd |
@@ -1963,7 +1964,7 @@ def _raise_ssl_error(self, ssl: Any, result: int) -> None: |
1963 | 1964 | raise SysCallError(errno, errorcode.get(errno)) |
1964 | 1965 | raise SysCallError(-1, "Unexpected EOF") |
1965 | 1966 | else: |
1966 | | - # TODO: This is untested. |
| 1967 | + # TODO: This is untested, but I think twisted hits it? |
1967 | 1968 | _raise_current_error() |
1968 | 1969 | elif error == _lib.SSL_ERROR_SSL and _lib.ERR_peek_error() != 0: |
1969 | 1970 | # In 3.0.x an unexpected EOF no longer triggers syscall error |
|
0 commit comments