Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Python 3 in bootstrap.py #110439

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
except ImportError:
lzma = None

assert sys.version_info.major == 3

if sys.platform == 'win32':
EXE_SUFFIX = ".exe"
else:
Expand Down
4 changes: 3 additions & 1 deletion x.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
os.execvp("python3", ["python3"] + sys.argv)
except OSError:
# Python 3 isn't available, fall back to python 2
pass
sys.stderr.write("Could not find Python 3. If you have Python 3 available, use it to invoke x.py.")
sys.stderr.write("If no Python 3 is available, consider installing it: https://www.python.org/downloads/")
exit(1)

rust_dir = os.path.dirname(os.path.abspath(__file__))
# For the import below, have Python search in src/bootstrap first.
Expand Down