Skip to content

Commit dda7ca5

Browse files
author
cclauss
committed
test: prepare test/testpy/__init__.py for Python 3
1 parent 9a26546 commit dda7ca5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/testpy/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
import re
3232
import ast
3333

34+
try:
35+
reduce # Python 2
36+
except NameError: # Python 3
37+
from functools import reduce
38+
3439

3540
FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
3641
FILES_PATTERN = re.compile(r"//\s+Files:(.*)")

0 commit comments

Comments
 (0)