Commit 16b62666 authored by Vadim Gorbachev's avatar Vadim Gorbachev Committed by Commit Bot

Python2 compatibility: fix flake8 report F632 F821


use '!=' instead of 'is not' with str
FileNotFoundError isn't exist in python2.7, use IOError instead.


Bug: chromium:948812
Change-Id: I241ff8a9321d612f2371a2a2e2deae948fa180e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1549168
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: 's avatarSergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60661}
parent 7cf4add6
......@@ -21,6 +21,12 @@ import tempfile
import time
from pathlib import Path
# for py2/py3 compatibility
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
ARGPARSE = argparse.ArgumentParser(
description=("A script that computes LoC for a build dir or from a"
"compile_commands.json file"),
......
......@@ -20,7 +20,7 @@ class OutProc(base.OutProc):
diff = difflib.unified_diff(expected_lines, actual_lines, lineterm="",
fromfile="expected_path")
diffstring = '\n'.join(diff)
if diffstring is not "":
if diffstring != "":
if "generated from a non-shipping build" in output.stdout:
return False
if not "generated from a shipping build" in output.stdout:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment