summaryrefslogtreecommitdiff
path: root/test/pseudo-tty/testcfg.py
diff options
context:
space:
mode:
authorcclauss <cclauss@bluewin.ch>2018-12-03 00:02:37 +0100
committerRich Trott <rtrott@gmail.com>2018-12-06 22:44:05 -0800
commit6028f70a0a3c8b8ce527e682d9284f68dce9e091 (patch)
tree31f66edcb0bc1ee19d31f66540035cb0f0fd273d /test/pseudo-tty/testcfg.py
parent29204f4ebcb6a722dfa8163ad079293dae6d8067 (diff)
downloadandroid-node-v8-6028f70a0a3c8b8ce527e682d9284f68dce9e091.tar.gz
android-node-v8-6028f70a0a3c8b8ce527e682d9284f68dce9e091.tar.bz2
android-node-v8-6028f70a0a3c8b8ce527e682d9284f68dce9e091.zip
test: prepare test/pseudo-tty/testcfg.py for Python 3
PR-URL: https://github.com/nodejs/node/pull/24791 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'test/pseudo-tty/testcfg.py')
-rw-r--r--test/pseudo-tty/testcfg.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/pseudo-tty/testcfg.py b/test/pseudo-tty/testcfg.py
index 9289ce4f10..85b304b09c 100644
--- a/test/pseudo-tty/testcfg.py
+++ b/test/pseudo-tty/testcfg.py
@@ -32,6 +32,11 @@ from os.path import join, exists, basename, isdir
import re
import utils
+try:
+ xrange # Python 2
+except NameError:
+ xrange = range # Python 3
+
FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
class TTYTestCase(test.TestCase):
@@ -51,7 +56,7 @@ class TTYTestCase(test.TestCase):
else: return str.startswith('==') or str.startswith('**')
def IsFailureOutput(self, output):
- f = file(self.expected)
+ f = open(self.expected)
# Convert output lines to regexps that we can match
env = { 'basename': basename(self.file) }
patterns = [ ]