diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 9ad79b0d..3f9298aa 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -260,8 +260,10 @@ def find_vs_path(path, msvc_version): ] p = subprocess.check_output(cmdline) if not p: - cmd = " ".join('"%s"' % i for i in cmdline) - print("could not find visual studio (using '%s')" % cmd) + # add quotes around any of the terms with spaces in them, so that + # the user can copy-and-paste the command. + cmdline = ['"%s"' % term if " " in term else term for term in cmdline] + print("could not find visual studio (using '%s')" % cmdline) sys.exit(1) # Strictly speaking the output may not be UTF-8.