Skip to content

Commit

Permalink
Update sysroot_ld_path.py for Python3 (#461)
Browse files Browse the repository at this point in the history
In Python 3, subprocess.check_output returns an encoding-independent
byte array. If passed universal_newlines=True, both Python 2 and 3
decode and return a UTF-8 string.

Issue: flutter/flutter#83043
  • Loading branch information
cbracken committed Jun 4, 2021
1 parent 91b3d1f commit 60e8349
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build/config/linux/sysroot_ld_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
import sys

if len(sys.argv) != 3:
print "Need two arguments"
print("Need two arguments")
sys.exit(1)

result = subprocess.check_output([sys.argv[1], sys.argv[2]]).strip()
result = subprocess.check_output([sys.argv[1], sys.argv[2]],
universal_newlines=True).strip()

print '"' + result + '"'
print('"%s"' % result)

0 comments on commit 60e8349

Please sign in to comment.