diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-06 18:18:01 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-06 18:18:01 +0300 |
commit | 01fbacb386809436dfa331780875aed72cb76118 (patch) | |
tree | 04c911ad96ff0523bd4d3e7a45c23cf2f2d7607d /contrib/python/prompt-toolkit/py3/prompt_toolkit/utils.py | |
parent | 48fb997d7f820a474b9094a72d9798a95ec612b7 (diff) | |
download | ydb-01fbacb386809436dfa331780875aed72cb76118.tar.gz |
intermediate changes
ref:b4f892f3c2b06a356c155f73c27efc5661a7fb89
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/utils.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/prompt_toolkit/utils.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/utils.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/utils.py index 8b501e5b23..4ceded34c4 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/utils.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/utils.py @@ -188,24 +188,27 @@ def is_windows() -> bool: """ True when we are using Windows. """ - return sys.platform.startswith("win") # E.g. 'win32', not 'darwin' or 'linux2' + return sys.platform == "win32" # Not 'darwin' or 'linux2' def is_windows_vt100_supported() -> bool: """ True when we are using Windows, but VT100 escape sequences are supported. """ - # Import needs to be inline. Windows libraries are not always available. - from prompt_toolkit.output.windows10 import is_win_vt100_enabled + if sys.platform == "win32": + # Import needs to be inline. Windows libraries are not always available. + from prompt_toolkit.output.windows10 import is_win_vt100_enabled - return is_windows() and is_win_vt100_enabled() + return is_win_vt100_enabled() + + return False def is_conemu_ansi() -> bool: """ True when the ConEmu Windows console is used. """ - return is_windows() and os.environ.get("ConEmuANSI", "OFF") == "ON" + return sys.platform == "win32" and os.environ.get("ConEmuANSI", "OFF") == "ON" def in_main_thread() -> bool: |