pmbootstrap.py: Check which version of Python pmbootstrap is run with (MR 2118)

This prevents people from getting strange syntax errors if they
accidentally run pmbootstrap with e.g. Python 2.
This commit is contained in:
Newbyte 2021-10-01 08:41:27 +02:00 committed by Clayton Craft
parent 5761a29f07
commit 446a8fc430
No known key found for this signature in database
GPG Key ID: 7A3461CA187CEA54
1 changed files with 7 additions and 0 deletions

View File

@ -1,8 +1,15 @@
#!/usr/bin/env python3
# -*- encoding: UTF-8 -*-
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# PYTHON_ARGCOMPLETE_OK
import sys
version = sys.version_info
if version < (3, 6):
print("You need at least Python 3.6 to run pmbootstrap")
print("(You are running it with Python " + str(version.major) +
"." + str(version.minor) + ")")
sys.exit()
import pmb
if __name__ == "__main__":