[Buildroot] [PATCH v2 3/4] utils/getdeveloperlib.py: use python3 explicitly

Arnout Vandecappelle arnout at mind.be
Thu Sep 16 18:42:01 UTC 2021



On 15/09/2021 21:48, Petr Vorel wrote:
> + remove python2 compatibility imports
> 
> library is used by support/scripts/pkg-stats and utils/get-developers
> which both use python3. Although library does not require shebang,
> it's better to state python3 use.

 Do you have some supporting evidence of this claim "it's better to add a shebang"?

 Looking at a few random projects with python files, I see none that do it.

 And it seems like a lot of noise to add this for no obvious gain. If it's about
documenting the minimum python version, it's not even correct: some of these
scripts will require python3.4 or python3.5 and that's not documented...

 Regards,
 Arnout

> 
> Tested with python3 -m py_compile.
> 
> Signed-off-by: Petr Vorel <petr.vorel at gmail.com>
> ---
> New in v2
> 
>  utils/getdeveloperlib.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/getdeveloperlib.py b/utils/getdeveloperlib.py
> index ce822320f8..74a3a420ee 100644
> --- a/utils/getdeveloperlib.py
> +++ b/utils/getdeveloperlib.py
> @@ -1,4 +1,5 @@
> -from __future__ import print_function
> +#!/usr/bin/env python3
> +
>  from io import open
>  import os
>  import re
> 


More information about the buildroot mailing list