PHP 8.2.30
Preview: command_context.py Size: 817 B
//opt/hc_python/lib64/python3.12/site-packages/pip/_internal/cli/command_context.py

from collections.abc import Generator
from contextlib import AbstractContextManager, ExitStack, contextmanager
from typing import TypeVar

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


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

    @contextmanager
    def main_context(self) -> Generator[None, None, 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: AbstractContextManager[_T]) -> _T:
        assert self._in_main_context

        return self._main_context.enter_context(context_provider)

Directory Contents

Dirs: 1 × Files: 13

Name Size Perms Modified Actions
- drwxr-xr-x 2025-12-03 08:02:41
Edit Download
7.02 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
8.51 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
30.30 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
817 B lrw-r--r-- 2025-12-03 08:02:41
Edit Download
5.58 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
2.75 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
4.23 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
10.66 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
4.56 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
13.48 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
7.19 KB lrw-r--r-- 2025-12-03 08:02:41
Edit Download
116 B lrw-r--r-- 2025-12-03 08:02:41
Edit Download
131 B lrw-r--r-- 2025-12-03 08:02:41
Edit Download

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