Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 526ff1d

Browse filesBrowse files
cclaussMylesBorins
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
Copy full SHA for 526ff1d

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Open diff view settings
Collapse file

‎test/pseudo-tty/testcfg.py‎

Copy file name to clipboardExpand all lines: test/pseudo-tty/testcfg.py
+6-1Lines changed: 6 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.