PHP 8.2.30
Preview: command_context.py Size: 975 B
//opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cli/command_context.py

from contextlib import contextmanager

from pip._vendor.contextlib2 import ExitStack

from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
    from typing import Iterator, ContextManager, TypeVar

    _T = TypeVar('_T', covariant=True)


class CommandContextMixIn(object):
    def __init__(self):
        # type: () -> None
        super(CommandContextMixIn, self).__init__()
        self._in_main_context = False
        self._main_context = ExitStack()

    @contextmanager
    def main_context(self):
        # type: () -> Iterator[None]
        assert not self._in_main_context

        self._in_main_context = True
        try:
            with self._main_context:
                yield
        finally:
            self._in_main_context = False

    def enter_context(self, context_provider):
        # type: (ContextManager[_T]) -> _T
        assert self._in_main_context

        return self._main_context.enter_context(context_provider)

Directory Contents

Dirs: 1 × Files: 12

Name Size Perms Modified Actions
- drwxr-xr-x 2024-03-03 22:36:51
Edit Download
6.39 KB lrw-r--r-- 2023-11-13 21:24:38
Edit Download
9.08 KB lrw-r--r-- 2023-11-13 21:24:38
Edit Download
28.11 KB lrw-r--r-- 2023-11-13 21:24:38
Edit Download
975 B lrw-r--r-- 2023-11-13 21:24:38
Edit Download
2.55 KB lrw-r--r-- 2023-11-13 21:24:38
Edit Download
2.78 KB lrw-r--r-- 2023-11-13 21:24:38
Edit Download
9.26 KB lrw-r--r-- 2023-11-13 21:24:38
Edit Download
8.91 KB lrw-r--r-- 2023-11-13 21:24:38
Edit Download
14.78 KB lrw-r--r-- 2023-11-13 21:24:38
Edit Download
5.38 KB lrw-r--r-- 2023-11-13 21:24:38
Edit Download
156 B lrw-r--r-- 2023-11-13 21:24:38
Edit Download
132 B lrw-r--r-- 2023-11-13 21:24:38
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).