Commit bf9d6afb authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[Py3] Get tools/testrunner/local closer to Py3

This modernizes python code without breaking Py2 compat.

Ran with command:

futurize --stage1 -w tools/testrunner

and manual fixup in statusfile_unittest.py to change to update import
path and change to absolute imports (similar to pool_unittest.py)

Bug: v8:9871
Change-Id: I8851e2188ef9285f2bd57cc07e959e22e1b05f6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2252548Reviewed-by: 's avatarTamer Tas <tmrts@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68490}
parent a6015b47
...@@ -27,12 +27,13 @@ ...@@ -27,12 +27,13 @@
# for py2/py3 compatibility # for py2/py3 compatibility
from __future__ import print_function from __future__ import print_function
from __future__ import absolute_import
import os import os
import re import re
from variants import ALL_VARIANTS from .variants import ALL_VARIANTS
from utils import Freeze from .utils import Freeze
# Possible outcomes # Possible outcomes
FAIL = "FAIL" FAIL = "FAIL"
......
...@@ -4,10 +4,17 @@ ...@@ -4,10 +4,17 @@
# found in the LICENSE file. # found in the LICENSE file.
from __future__ import absolute_import
import os
import sys
import unittest import unittest
import statusfile TOOLS_PATH = os.path.dirname(os.path.dirname(os.path.dirname(
from utils import Freeze os.path.abspath(__file__))))
sys.path.append(TOOLS_PATH)
from testrunner.local import statusfile
from testrunner.local.utils import Freeze
TEST_VARIABLES = { TEST_VARIABLES = {
......
...@@ -223,7 +223,7 @@ class TestGenerator(object): ...@@ -223,7 +223,7 @@ class TestGenerator(object):
return self return self
def __next__(self): def __next__(self):
return self.next() return next(self)
def next(self): def next(self):
return next(self._iterator) return next(self._iterator)
......
...@@ -35,7 +35,7 @@ import os ...@@ -35,7 +35,7 @@ import os
import platform import platform
import re import re
import subprocess import subprocess
import urllib2 import urllib
### Exit codes and their meaning. ### Exit codes and their meaning.
......
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