[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.17] tools/pygrub: Fix pygrub's --entry flag for python3



commit 7eb2a4eba1ecb5e3fb0b29ce88a4d521a71a9440
Author:     Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
AuthorDate: Tue Nov 14 13:53:01 2023 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Nov 14 13:53:01 2023 +0100

    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@xxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 40387f62061c4b9c780cda78b4ac0e29d478f648
    master date: 2023-10-18 15:44:31 +0100
---
 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 7cea496ade..49e627467b 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
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.