Skip to content

Commit c400a03

Browse files
q3kshentubot
authored andcommitted
Make check_vdso compatible with Python 2 and 3
This makes gVisor build with `python` set to Python 3. Fixes #8 PiperOrigin-RevId: 195216683
1 parent 23e6066 commit c400a03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vdso/check_vdso.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def CheckSegments(vdso_path):
6565
Args:
6666
vdso_path: Path to VDSO binary.
6767
"""
68-
output = subprocess.check_output(["readelf", "-lW", vdso_path])
68+
output = subprocess.check_output(["readelf", "-lW", vdso_path]).decode()
6969
lines = output.split("\n")
7070

7171
segments = []
@@ -143,7 +143,7 @@ def CheckData(vdso_path):
143143
Args:
144144
vdso_path: Path to VDSO binary.
145145
"""
146-
output = subprocess.check_output(["readelf", "-SW", vdso_path])
146+
output = subprocess.check_output(["readelf", "-SW", vdso_path]).decode()
147147
lines = output.split("\n")
148148

149149
found_text = False
@@ -179,7 +179,7 @@ def CheckRelocs(vdso_path):
179179
Args:
180180
vdso_path: Path to VDSO binary.
181181
"""
182-
output = subprocess.check_output(["readelf", "-r", vdso_path])
182+
output = subprocess.check_output(["readelf", "-r", vdso_path]).decode()
183183
if output.strip() != "There are no relocations in this file.":
184184
Fatal("VDSO contains relocations: %s", output)
185185

0 commit comments

Comments
 (0)