linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kunit: tool: Assert version requirement
@ 2021-06-16  9:40 SeongJae Park
  2021-06-16 21:14 ` Daniel Latypov
  0 siblings, 1 reply; 12+ messages in thread
From: SeongJae Park @ 2021-06-16  9:40 UTC (permalink / raw)
  To: brendanhiggins; +Cc: linux-kselftest, kunit-dev, linux-kernel, SeongJae Park

From: SeongJae Park <sjpark@amazon.de>

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)
    AssertionError

Signed-off-by: SeongJae Park <sjpark@amazon.de>
---
 tools/testing/kunit/kunit.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index be8d8d4a4e08..748d88178506 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -12,6 +12,8 @@ import sys
 import os
 import time
 
+assert sys.version_info >= (3, 7)
+
 from collections import namedtuple
 from enum import Enum, auto
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-07-12 19:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16  9:40 [PATCH] kunit: tool: Assert version requirement SeongJae Park
2021-06-16 21:14 ` Daniel Latypov
2021-06-17  7:39   ` SeongJae Park
2021-06-17  7:46     ` [PATCH v2] kunit: tool: Assert the " SeongJae Park
2021-06-22 23:28       ` Daniel Latypov
2021-06-22 23:55         ` Daniel Latypov
2021-06-28 13:37           ` SeongJae Park
2021-06-28 19:51             ` Brendan Higgins
2021-06-28 19:41       ` Brendan Higgins
2021-07-12 19:42         ` Shuah Khan
2021-07-12 19:47           ` SeongJae Park
2021-07-12 19:52           ` [PATCH v3] " SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).