Re: [PATCH] tools: hv: lsvmbus: change shebang to use python3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 01, 2024 at 08:35:55AM +0000, Anthony Nandaa wrote:
> This patch updates the shebang in the lsvmbus tool to use python3
> instead of python. The change is necessary because Python 2 has
> reached its end of life as of January 1, 2020, and is no longer
> maintained[1]. Many modern systems do not have python pointing to
> Python 2, and instead use python3.
> 
> By explicitly using python3, we ensure compatibility with modern
> systems since Python 2 is no longer being shipped by default.
> 
> This change also updates the file permissions to make the script
> executable, so that the script runs out of the box.
> Also, similar scripts within `tools/hv` have mode `755`:
> 
> ```
> -rwxr-xr-x 1 labuser labuser   930 Jun 28 16:15 hv_get_dhcp_info.sh
> -rwxr-xr-x 1 labuser labuser   622 Jun 28 16:15 hv_get_dns_info.sh
> -rwxr-xr-x 1 labuser labuser  1888 Jun 28 16:15 hv_set_ifconfig.sh
> ```
> 
> Before fix, this is what you get when you attempt to run `lsvmbus`:
> ```
> /usr/bin/env: ‘python’: No such file or directory
> ```
> 
> [1] https://www.python.org/doc/sunset-python-2/
> 
> Signed-off-by: Anthony Nandaa <profnandaa@xxxxxxxxx>

Have you checked if the scripts are compatible with python3?

Thanks,
Wei.

> ---
>  tools/hv/lsvmbus | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>  mode change 100644 => 100755 tools/hv/lsvmbus
> 
> diff --git a/tools/hv/lsvmbus b/tools/hv/lsvmbus
> old mode 100644
> new mode 100755
> index 55e7374bade0..23dcd8e705be
> --- a/tools/hv/lsvmbus
> +++ b/tools/hv/lsvmbus
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  # SPDX-License-Identifier: GPL-2.0
>  
>  import os
> -- 
> 2.33.8
> 
> 




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux