mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-09 11:11:26 +08:00
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:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user