From dda7ca5f060546098d3831972cfef0523f70c725 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 3 Dec 2018 10:04:51 +0100 Subject: [PATCH] test: prepare test/testpy/__init__.py for Python 3 --- test/testpy/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index 7ba9674d7d6e57..8e5cfdf9618b2f 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -31,6 +31,11 @@ import re import ast +try: + reduce # Python 2 +except NameError: # Python 3 + from functools import reduce + FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)") FILES_PATTERN = re.compile(r"//\s+Files:(.*)")