build_library: Fix getting integer from string

`string.atoi` was deprecated since at least the first release of
python2, and looks like it was dropped in python3.
This commit is contained in:
Krzesimir Nowak 2021-08-18 10:00:57 +02:00
parent ea0f478cfa
commit a314348a38

View File

@ -11,7 +11,7 @@ filename = sys.argv[1]
grubdir = sys.argv[2] grubdir = sys.argv[2]
outputdir = sys.argv[3] outputdir = sys.argv[3]
version = sys.argv[4] version = sys.argv[4]
bootoffset = string.atoi(subprocess.check_output(['cgpt', 'show', '-i', '2', '-b', filename])) * 512 bootoffset = int(subprocess.check_output(['cgpt', 'show', '-i', '2', '-b', filename])) * 512
with open(filename, "rb") as f: with open(filename, "rb") as f:
boot = f.read(440) boot = f.read(440)
f.seek(bootoffset) f.seek(bootoffset)