releasetools: Make common Python 3 compatible.

Bug: 131631303
Test: TreeHugger
Test: `python -m unittest test_common`
Test: `python3 -m unittest test_common`
Change-Id: I409fe30a5d71975c1d7b66e5e749843de530f1f9
This commit is contained in:
Tao Bao
2017-12-01 16:19:46 -08:00
parent 9392fb3905
commit da30cfae96
3 changed files with 38 additions and 23 deletions

View File

@@ -44,7 +44,7 @@ def _ReadFile(file_name, unpacked_name, round_up=False):
"""Constructs and returns a File object. Rounds up its size if needed."""
assert os.path.exists(unpacked_name)
with open(unpacked_name, 'r') as f:
with open(unpacked_name, 'rb') as f:
file_data = f.read()
file_size = len(file_data)
if round_up: