Delete python 2 branches from third-party stubs (#7741)

Since #7703, we no longer have third-party stubs that support Python 2, so code like `if sys.version_info >= (3, 0)` can be simplified.
This commit is contained in:
Akuli
2022-04-29 22:53:01 +03:00
committed by GitHub
parent 002c8e2586
commit e613fc483b
21 changed files with 40 additions and 203 deletions

View File

@@ -1,6 +1,7 @@
import ssl
import sys
from builtins import ConnectionError as ConnectionError
from collections.abc import Iterable
from http.client import HTTPConnection as _HTTPConnection, HTTPException as HTTPException
from typing import IO, Any
from typing_extensions import TypeAlias
@@ -8,14 +9,6 @@ from . import exceptions, util
from .packages import ssl_match_hostname
from .util import ssl_
if sys.version_info >= (3, 0):
from builtins import ConnectionError as ConnectionError
from http.client import HTTPConnection as _HTTPConnection, HTTPException as HTTPException
else:
from httplib import HTTPConnection as _HTTPConnection, HTTPException as HTTPException
class ConnectionError(Exception): ...
_TYPE_BODY: TypeAlias = bytes | IO[Any] | Iterable[bytes] | str
class DummyConnection: ...