[dts] [PATCH V3 1/3] framework: check the python version

Ma, LihongX lihongx.ma at intel.com
Fri Oct 23 09:51:00 CEST 2020


> -----Original Message-----
> From: Mo, YufengX <yufengx.mo at intel.com>
> Sent: Friday, October 23, 2020 3:10 PM
> To: dts at dpdk.org; Tu, Lijuan <lijuan.tu at intel.com>; Ma, LihongX
> <lihongx.ma at intel.com>
> Cc: Mo, YufengX <yufengx.mo at intel.com>
> Subject: [dts][PATCH V3 1/3] framework: check the python version
> 
> 
> implement a method to check the python version of tester and the server
> that run dts.
> If the version is python2, print a warning message.
> 
> Signed-off-by: yufengmx <yufengx.mo at intel.com>
> ---
>  framework/utils.py | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/framework/utils.py b/framework/utils.py index e74e6c5..9082e35
> +def check_dts_python_version():
> +    if sys.version_info.major < 3 or \
> +       sys.version_info.minor < 6 or \
> +       sys.version_info.micro < 9:
> +        print(RED(
> +            ("WARNING: Dts running node python version is lower than
> python 3.6, "
> +             "it is deprecated for use in DTS, "
> +             "and will not work in future releases.")), file=sys.stderr)
> +        print(RED("Please use Python >= 3.6.9 instead"),
> +file=sys.stderr)
> --
> 2.21.0

As the judgment condition is 'or', I think if my python3 version is 3.8.2, it will still print the warning information.
Can you check and optimize it ?


Regards,
Ma,lihong


More information about the dts mailing list