PHP 8.2.30
Preview: command_context.py Size: 760 B
//opt/alt/python311/lib/python3.11/site-packages/pip/_internal/cli/command_context.py

from contextlib import ExitStack, contextmanager
from typing import ContextManager, Iterator, 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) -> 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: 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:08:53
Edit Download
6.25 KB lrw-r--r-- 2026-01-07 23:10:30
Edit Download
7.61 KB lrw-r--r-- 2026-01-07 23:10:30
Edit Download
27.73 KB lrw-r--r-- 2026-01-07 23:10:30
Edit Download
760 B lrw-r--r-- 2026-01-07 23:10:30
Edit Download
2.41 KB lrw-r--r-- 2026-01-07 23:10:30
Edit Download
2.55 KB lrw-r--r-- 2026-01-07 23:10:30
Edit Download
10.54 KB lrw-r--r-- 2026-01-07 23:10:30
Edit Download
8.11 KB lrw-r--r-- 2026-01-07 23:10:30
Edit Download
16.70 KB lrw-r--r-- 2026-01-07 23:10:30
Edit Download
4.96 KB lrw-r--r-- 2026-01-07 23:10:30
Edit Download
116 B lrw-r--r-- 2026-01-07 23:10:30
Edit Download
132 B lrw-r--r-- 2026-01-07 23:10:30
Edit Download

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