Skip to content

Commit

Permalink
test: prepare test/pseudo-tty/testcfg.py for Python 3
Browse files Browse the repository at this point in the history
PR-URL: #24791
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
cclauss authored and rvagg committed Feb 28, 2019
1 parent f3d17cf commit 49788bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/pseudo-tty/testcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
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):
Expand All @@ -51,7 +56,7 @@ def IgnoreLine(self, str):
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 = [ ]
Expand Down

0 comments on commit 49788bb

Please sign in to comment.