|
1 | 1 | import email.message |
2 | 2 | import io |
3 | 3 | import ssl |
| 4 | +import sys |
4 | 5 | import types |
5 | 6 | from _typeshed import ReadableBuffer, SupportsRead, WriteableBuffer |
6 | 7 | from collections.abc import Callable, Iterable, Iterator, Mapping |
@@ -175,19 +176,31 @@ class HTTPConnection: |
175 | 176 | class HTTPSConnection(HTTPConnection): |
176 | 177 | # Can be `None` if `.connect()` was not called: |
177 | 178 | sock: ssl.SSLSocket | Any |
178 | | - def __init__( |
179 | | - self, |
180 | | - host: str, |
181 | | - port: int | None = None, |
182 | | - key_file: str | None = None, |
183 | | - cert_file: str | None = None, |
184 | | - timeout: float | None = ..., |
185 | | - source_address: tuple[str, int] | None = None, |
186 | | - *, |
187 | | - context: ssl.SSLContext | None = None, |
188 | | - check_hostname: bool | None = None, |
189 | | - blocksize: int = 8192, |
190 | | - ) -> None: ... |
| 179 | + if sys.version_info >= (3, 12): |
| 180 | + def __init__( |
| 181 | + self, |
| 182 | + host: str, |
| 183 | + port: str | None = None, |
| 184 | + *, |
| 185 | + timeout: float | None = ..., |
| 186 | + source_address: tuple[str, int] | None = None, |
| 187 | + context: ssl.SSLContext | None = None, |
| 188 | + blocksize: int = 8192, |
| 189 | + ) -> None: ... |
| 190 | + else: |
| 191 | + def __init__( |
| 192 | + self, |
| 193 | + host: str, |
| 194 | + port: int | None = None, |
| 195 | + key_file: str | None = None, |
| 196 | + cert_file: str | None = None, |
| 197 | + timeout: float | None = ..., |
| 198 | + source_address: tuple[str, int] | None = None, |
| 199 | + *, |
| 200 | + context: ssl.SSLContext | None = None, |
| 201 | + check_hostname: bool | None = None, |
| 202 | + blocksize: int = 8192, |
| 203 | + ) -> None: ... |
191 | 204 |
|
192 | 205 | class HTTPException(Exception): ... |
193 | 206 |
|
|
0 commit comments