summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorcclauss <cclauss@bluewin.ch>2018-12-07 11:04:24 +0100
committerRich Trott <rtrott@gmail.com>2018-12-10 15:32:16 -0800
commit59065308349b7cb8d93439324afc00b7c51fecdf (patch)
tree2ae5713949dd94d5e18a1175da00edb0d976cb76 /tools
parent44a5fe145759a2fa43247da2f40a55df23572944 (diff)
downloadandroid-node-v8-59065308349b7cb8d93439324afc00b7c51fecdf.tar.gz
android-node-v8-59065308349b7cb8d93439324afc00b7c51fecdf.tar.bz2
android-node-v8-59065308349b7cb8d93439324afc00b7c51fecdf.zip
tools: prepare tools/testp.py for Python 3
PR-URL: https://github.com/nodejs/node/pull/24890 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/test.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/test.py b/tools/test.py
index be2179e6fb..ff20cb133c 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -44,21 +44,26 @@ import utils
import multiprocessing
import errno
import copy
-import ast
from os.path import join, dirname, abspath, basename, isdir, exists
from datetime import datetime
from Queue import Queue, Empty
try:
- reduce # Python 2
+ cmp # Python 2
+except NameError:
+ def cmp(x, y): # Python 3
+ return (x > y) - (x < y)
+
+try:
+ reduce # Python 2
except NameError: # Python 3
from functools import reduce
try:
- xrange # Python 2
+ xrange # Python 2
except NameError:
- xrange = range # Python 3
+ xrange = range # Python 3
logger = logging.getLogger('testrunner')
skip_regex = re.compile(r'# SKIP\S*\s+(.*)', re.IGNORECASE)