]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
tools/pygrub: Fix pygrub's --entry flag for python3
authorAlejandro Vallejo <alejandro.vallejo@cloud.com>
Tue, 14 Nov 2023 12:53:01 +0000 (13:53 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 14 Nov 2023 12:53:01 +0000 (13:53 +0100)
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>
master commit: 40387f62061c4b9c780cda78b4ac0e29d478f648
master date: 2023-10-18 15:44:31 +0100

tools/pygrub/src/pygrub

index 7cea496ade0843c8be454bfdd5eb84f65b10e6cd..49e627467b020c412c1b190dc413a8d855616ae0 100755 (executable)
@@ -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