Skip to content

Commit 526ff1d

Browse files
cclaussMylesBorins
cclauss
authored andcommitted
test: prepare test/pseudo-tty/testcfg.py for Python 3
PR-URL: #24791 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 15632c3 commit 526ff1d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/pseudo-tty/testcfg.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
import re
3333
import utils
3434

35+
try:
36+
xrange # Python 2
37+
except NameError:
38+
xrange = range # Python 3
39+
3540
FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
3641

3742
class TTYTestCase(test.TestCase):
@@ -51,7 +56,7 @@ def IgnoreLine(self, str):
5156
else: return str.startswith('==') or str.startswith('**')
5257

5358
def IsFailureOutput(self, output):
54-
f = file(self.expected)
59+
f = open(self.expected)
5560
# Convert output lines to regexps that we can match
5661
env = { 'basename': basename(self.file) }
5762
patterns = [ ]

0 commit comments

Comments
 (0)