]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
kunit: tool: Assert the version requirement
authorSeongJae Park <sjpark@amazon.de>
Mon, 12 Jul 2021 19:52:58 +0000 (19:52 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 12 Jul 2021 20:02:32 +0000 (14:02 -0600)
commitdf4b0807ca1a62822342d404b863eff933d15762
tree21ab7860057246d403655d9ac37ab4c65546fd73
parent58c965d84e14196e762c803c50c7b207a9e352bc
kunit: tool: Assert the version requirement

Commit 87c9c1631788 ("kunit: tool: add support for QEMU") on the 'next'
tree adds 'from __future__ import annotations' in 'kunit_kernel.py'.
Because it is supported on only >=3.7 Python, people using older Python
will get below error:

    Traceback (most recent call last):
      File "./tools/testing/kunit/kunit.py", line 20, in <module>
        import kunit_kernel
      File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line 9
        from __future__ import annotations
        ^
    SyntaxError: future feature annotations is not defined

This commit adds a version assertion in 'kunit.py', so that people get
more explicit error message like below:

    Traceback (most recent call last):
      File "./tools/testing/kunit/kunit.py", line 15, in <module>
        assert sys.version_info >= (3, 7), "Python version is too old"
    AssertionError: Python version is too old

Signed-off-by: SeongJae Park <sjpark@amazon.de>
Acked-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/kunit/kunit.py