PHP 8.2.30
Preview: command_context.py Size: 774 B
//opt/alt/python312/lib/python3.12/site-packages/pip/_internal/cli/command_context.py

from contextlib import ExitStack, contextmanager
from typing import ContextManager, Generator, 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: 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 2026-02-10 08:09:14
Edit Download
6.53 KB lrw-r--r-- 2026-01-08 19:19:46
Edit Download
8.53 KB lrw-r--r-- 2026-01-08 19:19:46
Edit Download
29.41 KB lrw-r--r-- 2026-01-08 19:19:46
Edit Download
774 B lrw-r--r-- 2026-01-08 19:19:46
Edit Download
2.75 KB lrw-r--r-- 2026-01-08 19:19:46
Edit Download
4.24 KB lrw-r--r-- 2026-01-08 19:19:46
Edit Download
10.55 KB lrw-r--r-- 2026-01-08 19:19:46
Edit Download
1.92 KB lrw-r--r-- 2026-01-08 19:19:46
Edit Download
17.94 KB lrw-r--r-- 2026-01-08 19:19:46
Edit Download
5.00 KB lrw-r--r-- 2026-01-08 19:19:46
Edit Download
116 B lrw-r--r-- 2026-01-08 19:19:46
Edit Download
132 B lrw-r--r-- 2026-01-08 19:19:46
Edit Download

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