Skip to content

Commit f3f4ef2

Browse files
authored
Merge pull request #9384 from jdufresne/contextlib
2 parents 376e123 + d9b5525 commit f3f4ef2

File tree

14 files changed

+32
-658
lines changed

14 files changed

+32
-658
lines changed

news/contextlib2.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove contextlib2.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ drop = [
4949
[tool.vendoring.typing-stubs]
5050
six = ["six.__init__", "six.moves.__init__", "six.moves.configparser"]
5151
appdirs = []
52-
contextlib2 = []
5352

5453
[tool.vendoring.license.directories]
5554
setuptools = "pkg_resources"

src/pip/_internal/cli/command_context.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from contextlib import contextmanager
1+
from contextlib import ExitStack, contextmanager
22
from typing import TYPE_CHECKING
33

4-
from pip._vendor.contextlib2 import ExitStack
5-
64
if TYPE_CHECKING:
75
from typing import ContextManager, Iterator, TypeVar
86

src/pip/_internal/cli/parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
import shutil
99
import sys
1010
import textwrap
11+
from contextlib import suppress
1112
from typing import TYPE_CHECKING
1213

13-
from pip._vendor.contextlib2 import suppress
14-
1514
from pip._internal.cli.status_codes import UNKNOWN_ERROR
1615
from pip._internal.configuration import Configuration, ConfigurationError
1716
from pip._internal.utils.misc import redact_auth_from_url, strtobool

src/pip/_internal/req/req_tracker.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import os
55
from typing import TYPE_CHECKING
66

7-
from pip._vendor import contextlib2
8-
97
from pip._internal.utils.temp_dir import TempDirectory
108

119
if TYPE_CHECKING:
@@ -49,7 +47,7 @@ def update_env_context_manager(**changes):
4947
def get_requirement_tracker():
5048
# type: () -> Iterator[RequirementTracker]
5149
root = os.environ.get('PIP_REQ_TRACKER')
52-
with contextlib2.ExitStack() as ctx:
50+
with contextlib.ExitStack() as ctx:
5351
if root is None:
5452
root = ctx.enter_context(
5553
TempDirectory(kind='req-tracker')

src/pip/_internal/utils/temp_dir.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
import logging
44
import os.path
55
import tempfile
6-
from contextlib import contextmanager
6+
from contextlib import ExitStack, contextmanager
77
from typing import TYPE_CHECKING
88

9-
from pip._vendor.contextlib2 import ExitStack
10-
119
from pip._internal.utils.misc import enum, rmtree
1210

1311
if TYPE_CHECKING:

src/pip/_vendor/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def vendored(modulename):
6262
vendored("cachecontrol")
6363
vendored("certifi")
6464
vendored("colorama")
65-
vendored("contextlib2")
6665
vendored("distlib")
6766
vendored("distro")
6867
vendored("html5lib")

src/pip/_vendor/contextlib2.LICENSE.txt

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)