]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
tools/pygrub: Fix pygrub's --entry flag for python3
authorAlejandro Vallejo <alejandro.vallejo@cloud.com>
Wed, 11 Oct 2023 12:25:20 +0000 (13:25 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 Oct 2023 14:44:31 +0000 (15:44 +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>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
tools/pygrub/src/pygrub

index dcdfc04ff00f2e32b193b0b53d54ecbfefc8b8e0..541e562327b67ae4d005bf47882d961fd5fee5a4 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