PHP 8.2.30
Preview: command_context.py Size: 774 B
/opt/alt/python38/lib/python3.8/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 2024-03-03 22:49:50
Edit Download
6.52 KB lrw-r--r-- 2023-11-13 21:40:26
Edit Download
7.96 KB lrw-r--r-- 2023-11-13 21:40:26
Edit Download
29.28 KB lrw-r--r-- 2023-11-13 21:40:26
Edit Download
774 B lrw-r--r-- 2023-11-13 21:40:26
Edit Download
2.41 KB lrw-r--r-- 2023-11-13 21:40:26
Edit Download
2.55 KB lrw-r--r-- 2023-11-13 21:40:26
Edit Download
10.56 KB lrw-r--r-- 2023-11-13 21:40:26
Edit Download
1.92 KB lrw-r--r-- 2023-11-13 21:40:26
Edit Download
17.75 KB lrw-r--r-- 2023-11-13 21:40:26
Edit Download
4.98 KB lrw-r--r-- 2023-11-13 21:40:26
Edit Download
116 B lrw-r--r-- 2023-11-13 21:40:26
Edit Download
132 B lrw-r--r-- 2023-11-13 21:40:26
Edit Download

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