From: Jaehoon Chung Date: Mon, 14 Oct 2024 23:59:48 +0000 (+0900) Subject: scripts: sd_fusing: Check the minimum required Python version X-Git-Tag: accepted/tizen/unified/20241101.174134~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03893a7ca6968b6bb07776c1e34d9e7bc98bc2ec;p=platform%2Fkernel%2Fu-boot.git scripts: sd_fusing: Check the minimum required Python version "extend" of action was added since python3.8. If python version is lower than 3.8, it will be occurred the error like below. Traceback (most recent call last): File "./scripts/tizen/sd_fusing.py", line 1375, in help="binary to flash, may be used multiple times") File "/usr/local/lib/python3.7/argparse.py", line 1358, in add_argument raise ValueError('unknown action "%s"' % (action_class,)) ValueError: unknown action "extend" Refer to Python Doc: 3.7 - https://docs.python.org/3.7/library/argparse.html#action 3.8 - https://docs.python.org/3.8/library/argparse.html#action Change-Id: I8d9deafcddbe67f80adc310d01f22891a2d802ae Signed-off-by: Jaehoon Chung --- diff --git a/scripts/tizen/sd_fusing.py b/scripts/tizen/sd_fusing.py index 4505bbbd94..4d0dc0caf9 100755 --- a/scripts/tizen/sd_fusing.py +++ b/scripts/tizen/sd_fusing.py @@ -15,7 +15,7 @@ import sys import tarfile import tempfile -__version__ = "1.1.12" +__version__ = "1.1.13" Format = False Device = "" @@ -1397,8 +1397,14 @@ def logging_notice(msg, *args, **kws): logging.root.notice(msg, *args, **kws) logging.notice = logging_notice +def check_python_version(): + required_min_ver=(3,8) + if sys.version_info[:2] < required_min_ver: + print("Minimum required Python version is 3.8") + sys.exit(1) if __name__ == '__main__': + check_python_version() parser = argparse.ArgumentParser(description="For {}, version {}".format( ", ".join([v.long_name for k,v in TARGETS.items()]), __version__