From 6e74ad1557beffa22511a8b7b1575305837c161f Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 15 Oct 2024 08:59:48 +0900 Subject: [PATCH] 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 --- sd_fusing.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sd_fusing.py b/sd_fusing.py index 4505bbb..4d0dc0c 100755 --- a/sd_fusing.py +++ b/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__ -- 2.34.1