env activate: use Win-compatible print on Windows (#42755)

Use "echo" instead of "printf" on Windows.
This commit is contained in:
John W. Parent 2024-02-21 14:02:04 -05:00 committed by GitHub
parent 7d728822f0
commit 4bc52fc1a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -270,7 +270,8 @@ def create_temp_env_directory():
def _tty_info(msg):
"""tty.info like function that prints the equivalent printf statement for eval."""
decorated = f'{colorize("@*b{==>}")} {msg}\n'
print(f"printf {shlex.quote(decorated)};")
executor = "echo" if sys.platform == "win32" else "printf"
print(f"{executor} {shlex.quote(decorated)};")
def env_activate(args):