* [PATCH] tools/pygrub: Fix pygrub's --entry flag for python3
@ 2023-10-11 12:25 Alejandro Vallejo
2023-10-11 13:39 ` [PATCH for-4.18] " Andrew Cooper
2023-10-11 13:39 ` Andrew Cooper
0 siblings, 2 replies; 4+ messages in thread
From: Alejandro Vallejo @ 2023-10-11 12:25 UTC (permalink / raw)
To: Xen-devel; +Cc: Alejandro Vallejo, Wei Liu, Anthony PERARD
string.atoi() has been deprecated since Python 2.0, has a big scary warning
in the python2.7 docs and is absent from python3 altogether. int() does the
same thing and is compatible with both.
See https://docs.python.org/2/library/string.html#string.atoi:
Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
tools/pygrub/src/pygrub | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index dcdfc04ff0..541e562327 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -731,7 +731,7 @@ class Grub:
def get_entry_idx(cf, entry):
# first, see if the given entry is numeric
try:
- idx = string.atoi(entry)
+ idx = int(entry)
return idx
except ValueError:
pass
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH for-4.18] tools/pygrub: Fix pygrub's --entry flag for python3
2023-10-11 12:25 [PATCH] tools/pygrub: Fix pygrub's --entry flag for python3 Alejandro Vallejo
@ 2023-10-11 13:39 ` Andrew Cooper
2023-10-11 13:39 ` Andrew Cooper
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2023-10-11 13:39 UTC (permalink / raw)
To: Alejandro Vallejo, Xen-devel, Henry Wang; +Cc: Wei Liu, Anthony PERARD
On 11/10/2023 8:25 pm, Alejandro Vallejo wrote:
> string.atoi() has been deprecated since Python 2.0, has a big scary warning
> in the python2.7 docs and is absent from python3 altogether. int() does the
> same thing and is compatible with both.
>
> See https://docs.python.org/2/library/string.html#string.atoi:
>
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
> tools/pygrub/src/pygrub | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
> index dcdfc04ff0..541e562327 100755
> --- a/tools/pygrub/src/pygrub
> +++ b/tools/pygrub/src/pygrub
> @@ -731,7 +731,7 @@ class Grub:
> def get_entry_idx(cf, entry):
> # first, see if the given entry is numeric
> try:
> - idx = string.atoi(entry)
> + idx = int(entry)
> return idx
> except ValueError:
> pass
CC Henry for 4.18. This was discovered late in the XSA-443 work and is
one small extra bit of Python3 work.
Thanks,
~Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH for-4.18] tools/pygrub: Fix pygrub's --entry flag for python3
2023-10-11 12:25 [PATCH] tools/pygrub: Fix pygrub's --entry flag for python3 Alejandro Vallejo
2023-10-11 13:39 ` [PATCH for-4.18] " Andrew Cooper
@ 2023-10-11 13:39 ` Andrew Cooper
2023-10-11 13:41 ` Henry Wang
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2023-10-11 13:39 UTC (permalink / raw)
To: Alejandro Vallejo, Xen-devel, Henry Wang; +Cc: Wei Liu, Anthony PERARD
On 11/10/2023 8:25 pm, Alejandro Vallejo wrote:
> string.atoi() has been deprecated since Python 2.0, has a big scary warning
> in the python2.7 docs and is absent from python3 altogether. int() does the
> same thing and is compatible with both.
>
> See https://docs.python.org/2/library/string.html#string.atoi:
>
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
> tools/pygrub/src/pygrub | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
> index dcdfc04ff0..541e562327 100755
> --- a/tools/pygrub/src/pygrub
> +++ b/tools/pygrub/src/pygrub
> @@ -731,7 +731,7 @@ class Grub:
> def get_entry_idx(cf, entry):
> # first, see if the given entry is numeric
> try:
> - idx = string.atoi(entry)
> + idx = int(entry)
> return idx
> except ValueError:
> pass
CC Henry for 4.18. This was discovered late in the XSA-443 work and is
one small extra bit of Python3 work.
Thanks,
~Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH for-4.18] tools/pygrub: Fix pygrub's --entry flag for python3
2023-10-11 13:39 ` Andrew Cooper
@ 2023-10-11 13:41 ` Henry Wang
0 siblings, 0 replies; 4+ messages in thread
From: Henry Wang @ 2023-10-11 13:41 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Alejandro Vallejo, Xen-devel, Wei Liu, Anthony PERARD
Hi Andrew, Alejandro,
> On Oct 11, 2023, at 21:39, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> On 11/10/2023 8:25 pm, Alejandro Vallejo wrote:
>> string.atoi() has been deprecated since Python 2.0, has a big scary warning
>> in the python2.7 docs and is absent from python3 altogether. int() does the
>> same thing and is compatible with both.
>>
>> See https://docs.python.org/2/library/string.html#string.atoi:
>>
>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>> ---
>> tools/pygrub/src/pygrub | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
>> index dcdfc04ff0..541e562327 100755
>> --- a/tools/pygrub/src/pygrub
>> +++ b/tools/pygrub/src/pygrub
>> @@ -731,7 +731,7 @@ class Grub:
>> def get_entry_idx(cf, entry):
>> # first, see if the given entry is numeric
>> try:
>> - idx = string.atoi(entry)
>> + idx = int(entry)
>> return idx
>> except ValueError:
>> pass
>
> CC Henry for 4.18. This was discovered late in the XSA-443 work and is
> one small extra bit of Python3 work.
Thanks.
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
Kind regards,
Henry
>
> Thanks,
>
> ~Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-11 13:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-11 12:25 [PATCH] tools/pygrub: Fix pygrub's --entry flag for python3 Alejandro Vallejo
2023-10-11 13:39 ` [PATCH for-4.18] " Andrew Cooper
2023-10-11 13:39 ` Andrew Cooper
2023-10-11 13:41 ` Henry Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.