Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Commit

Permalink
Make check_vdso compatible with Python 2 and 3
Browse files Browse the repository at this point in the history
This makes gVisor build with `python` set to Python 3.

Fixes google#8

PiperOrigin-RevId: 195216683
Change-Id: I1c8b86ad91a0844f7c3c85839d53f3fcba10813e
  • Loading branch information
q3k authored and shentubot committed May 3, 2018
1 parent a61def1 commit 9c665c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vdso/check_vdso.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def CheckSegments(vdso_path):
Args:
vdso_path: Path to VDSO binary.
"""
output = subprocess.check_output(["readelf", "-lW", vdso_path])
output = subprocess.check_output(["readelf", "-lW", vdso_path]).decode()
lines = output.split("\n")

segments = []
Expand Down Expand Up @@ -143,7 +143,7 @@ def CheckData(vdso_path):
Args:
vdso_path: Path to VDSO binary.
"""
output = subprocess.check_output(["readelf", "-SW", vdso_path])
output = subprocess.check_output(["readelf", "-SW", vdso_path]).decode()
lines = output.split("\n")

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

Expand Down

0 comments on commit 9c665c4

Please sign in to comment.