tools/pygrub: Fix pygrub's --entry flag for python3

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>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
Alejandro Vallejo authored and Andrew Cooper committed 2023-10-18 15:44:31 +01:00
1 parent 26ea12d940
commit 40387f6206
1 file changed
+1 -1
+1 -1
View File
@@ -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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.