From 446a8fc4305acec7a61e0c4086a8f8beed2b3b37 Mon Sep 17 00:00:00 2001 From: Newbyte Date: Fri, 1 Oct 2021 08:41:27 +0200 Subject: [PATCH] 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. --- pmbootstrap.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pmbootstrap.py b/pmbootstrap.py index c1c2fea2..e667a150 100755 --- a/pmbootstrap.py +++ b/pmbootstrap.py @@ -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__":