Skip to content

Commit

Permalink
test: from functools import reduce in test/testpy/__init__.py
Browse files Browse the repository at this point in the history
$ __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: #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>
  • Loading branch information
cclauss authored and BethGriggs committed Dec 17, 2018
1 parent 1e09629 commit 649a728
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/testpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
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:(.*)")
Expand Down

0 comments on commit 649a728

Please sign in to comment.