Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
news
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sartika Aritonang
news
Commits
fadcc7b8
Commit
fadcc7b8
authored
May 29, 2020
by
Sartika Aritonang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
c86d493e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
command_context.py
stbi/Lib/site-packages/pip/_internal/cli/command_context.py
+36
-0
No files found.
stbi/Lib/site-packages/pip/_internal/cli/command_context.py
0 → 100644
View file @
fadcc7b8
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment