From a67d37d226feddee544bc9a47b8f977ada6f731e Mon Sep 17 00:00:00 2001 From: cclauss Date: Fri, 7 Dec 2018 09:30:06 +0100 Subject: [PATCH] test: prepare test/pseudo-tty/testcfg.py Python 3 PR-URL: https://github.com/nodejs/node/pull/24887 Reviewed-By: Rich Trott Reviewed-By: Daniel Bevenius --- test/pseudo-tty/testcfg.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/pseudo-tty/testcfg.py b/test/pseudo-tty/testcfg.py index 85b304b09c0a81..c12a16f8059e20 100644 --- a/test/pseudo-tty/testcfg.py +++ b/test/pseudo-tty/testcfg.py @@ -1,4 +1,3 @@ -from __future__ import print_function # Copyright 2008 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -26,12 +25,19 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +from __future__ import print_function + import test import os from os.path import join, exists, basename, isdir import re import utils +try: + reduce # Python 2 +except NameError: # Python 3 + from functools import reduce + try: xrange # Python 2 except NameError: