Skip to content

Commit

Permalink
Convert PRESUBMIT.py to python3
Browse files Browse the repository at this point in the history
Bug: 1212126
Change-Id: I222a407de9afece6ca6dd05d193b396e3dbb53f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2930880
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Dan H <harringtond@chromium.org>
Cr-Commit-Position: refs/heads/master@{#888468}
  • Loading branch information
Dan Harrington authored and Chromium LUCI CQ committed Jun 2, 2021
1 parent 6013b6d commit 3cde671
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ui/resources/PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
for the rules we're checking against here.
"""

USE_PYTHON3 = True


def CheckChangeOnUpload(input_api, output_api):
return _CommonChecks(input_api, output_api)
Expand Down
2 changes: 1 addition & 1 deletion ui/resources/resource_check/resource_scale_factors.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def RunChecks(self):
def ImageSize(filename):
with open(filename, 'rb', buffering=0) as f:
data = f.read(24)
if data[:8] != '\x89PNG\r\n\x1A\n' or data[12:16] != 'IHDR':
if data[:8] != b'\x89PNG\r\n\x1A\n' or data[12:16] != b'IHDR':
raise InvalidPNGException
return struct.unpack('>ii', data[16:24])

Expand Down

0 comments on commit 3cde671

Please sign in to comment.