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 <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
cclauss authored and BethGriggs committed Feb 12, 2019
1 parent 544a20f commit 5e29865
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 5e29865

Please sign in to comment.