提交 7e506743 编写于 作者: E Emil Burzo

extract function to misc

上级 be084e0f
......@@ -864,3 +864,10 @@ def protect_pip_from_modification_on_windows(modifying_pip):
'To modify pip, please run the following command:\n{}'
.format(" ".join(new_command))
)
def is_console_interactive():
# type: () -> bool
"""Is this console interactive?
"""
return sys.stdin is not None and sys.stdin.isatty()
......@@ -13,6 +13,7 @@ from pip._internal.utils.misc import (
display_path,
rmtree,
split_auth_from_netloc,
is_console_interactive
)
from pip._internal.utils.subprocess import make_command
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
......@@ -188,7 +189,7 @@ class Subversion(VersionControl):
def __init__(self, use_interactive=None):
# type: (bool) -> None
if use_interactive is None:
use_interactive = sys.stdin and sys.stdin.isatty()
use_interactive = is_console_interactive()
self.use_interactive = use_interactive
# This member is used to cache the fetched version of the current
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册