From 40387f62061c4b9c780cda78b4ac0e29d478f648 Mon Sep 17 00:00:00 2001 From: Alejandro Vallejo Date: Wed, 11 Oct 2023 13:25:20 +0100 Subject: [PATCH] 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 Reviewed-by: Andrew Cooper Release-acked-by: Henry Wang --- 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