Skip to content

Commit 957ecbe

Browse files
cclaussrvagg
cclauss
authored andcommitted
test: use print() function on both Python 2 and 3
PR-URL: #24485 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent b1dee7d commit 957ecbe

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

test/message/testcfg.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
# Copyright 2008 the V8 project authors. All rights reserved.
23
# Redistribution and use in source and binary forms, with or without
34
# modification, are permitted provided that the following conditions are
@@ -67,22 +68,22 @@ def IsFailureOutput(self, output):
6768
raw_lines = (output.stdout + output.stderr).split('\n')
6869
outlines = [ s for s in raw_lines if not self.IgnoreLine(s) ]
6970
if len(outlines) != len(patterns):
70-
print "length differs."
71-
print "expect=%d" % len(patterns)
72-
print "actual=%d" % len(outlines)
73-
print "patterns:"
71+
print("length differs.")
72+
print("expect=%d" % len(patterns))
73+
print("actual=%d" % len(outlines))
74+
print("patterns:")
7475
for i in xrange(len(patterns)):
75-
print "pattern = %s" % patterns[i]
76-
print "outlines:"
76+
print("pattern = %s" % patterns[i])
77+
print("outlines:")
7778
for i in xrange(len(outlines)):
78-
print "outline = %s" % outlines[i]
79+
print("outline = %s" % outlines[i])
7980
return True
8081
for i in xrange(len(patterns)):
8182
if not re.match(patterns[i], outlines[i]):
82-
print "match failed"
83-
print "line=%d" % i
84-
print "expect=%s" % patterns[i]
85-
print "actual=%s" % outlines[i]
83+
print("match failed")
84+
print("line=%d" % i)
85+
print("expect=%s" % patterns[i])
86+
print("actual=%s" % outlines[i])
8687
return True
8788
return False
8889

test/pseudo-tty/testcfg.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
# Copyright 2008 the V8 project authors. All rights reserved.
23
# Redistribution and use in source and binary forms, with or without
34
# modification, are permitted provided that the following conditions are
@@ -65,22 +66,22 @@ def IsFailureOutput(self, output):
6566
raw_lines = (output.stdout + output.stderr).split('\n')
6667
outlines = [ s.strip() for s in raw_lines if not self.IgnoreLine(s) ]
6768
if len(outlines) != len(patterns):
68-
print "length differs."
69-
print "expect=%d" % len(patterns)
70-
print "actual=%d" % len(outlines)
71-
print "patterns:"
69+
print("length differs.")
70+
print("expect=%d" % len(patterns))
71+
print("actual=%d" % len(outlines))
72+
print("patterns:")
7273
for i in xrange(len(patterns)):
73-
print "pattern = %s" % patterns[i]
74-
print "outlines:"
74+
print("pattern = %s" % patterns[i])
75+
print("outlines:")
7576
for i in xrange(len(outlines)):
76-
print "outline = %s" % outlines[i]
77+
print("outline = %s" % outlines[i])
7778
return True
7879
for i in xrange(len(patterns)):
7980
if not re.match(patterns[i], outlines[i]):
80-
print "match failed"
81-
print "line=%d" % i
82-
print "expect=%s" % patterns[i]
83-
print "actual=%s" % outlines[i]
81+
print("match failed")
82+
print("line=%d" % i)
83+
print("expect=%s" % patterns[i])
84+
print("actual=%s" % outlines[i])
8485
return True
8586
return False
8687

0 commit comments

Comments
 (0)