summaryrefslogtreecommitdiff
path: root/test/testpy
diff options
context:
space:
mode:
authorcclauss <cclauss@bluewin.ch>2018-12-11 12:38:09 +0100
committerRich Trott <rtrott@gmail.com>2018-12-13 17:20:12 -0800
commit7ee61fb3e564317cc64b78c78b8d926acedd2fc9 (patch)
treebb68342405c282395200902b37bff91d85cc73a6 /test/testpy
parentafeb56adf0c106cc4535d0ee20da078478be7ca2 (diff)
downloadandroid-node-v8-7ee61fb3e564317cc64b78c78b8d926acedd2fc9.tar.gz
android-node-v8-7ee61fb3e564317cc64b78c78b8d926acedd2fc9.tar.bz2
android-node-v8-7ee61fb3e564317cc64b78c78b8d926acedd2fc9.zip
test: from functools import reduce in test/testpy/__init__.py
$ __make lint-py__ # When run on Python 3 ``` PYTHONPATH=tools/pip python -m flake8 . \ --count --show-source --statistics --select=E901,E999,F821,F822,F823 \ --exclude=.git,deps,lib,src,tools/*_macros.py,tools/gyp,tools/inspector_protocol,tools/jinja2,tools/markupsafe,tools/pip ./test/testpy/__init__.py:119:37: F821 undefined name 'reduce' file_path = join(self.root, reduce(join, test[1:], "")) ^ ./test/testpy/__init__.py:161:37: F821 undefined name 'reduce' file_path = join(self.root, reduce(join, test[1:], "") + ".js") ^ 2 F821 undefined name 'reduce' 2 make: *** [lint-py] Error 1 ``` PR-URL: https://github.com/nodejs/node/pull/24954 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/testpy')
-rw-r--r--test/testpy/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py
index 7ba9674d7d..7d23c47214 100644
--- a/test/testpy/__init__.py
+++ b/test/testpy/__init__.py
@@ -31,6 +31,11 @@ from os.path import join, dirname, exists, splitext
import re
import ast
+try:
+ reduce
+except NameError:
+ from functools import reduce
+
FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
FILES_PATTERN = re.compile(r"//\s+Files:(.*)")