mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
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>
This commit is contained in:
1 parent
bf4faf3ffc
commit
b60808a2da
1 file changed
+9
-4
+9
-4
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user