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 40773c0

Browse filesBrowse files
cclausscodebytere
authored andcommitted
test: use print() function on both Python 2 and 3
PR-URL: #24485 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 2ffbde3 commit 40773c0
Copy full SHA for 40773c0

File tree

Expand file treeCollapse file tree

2 files changed

+24
-22
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+24
-22
lines changed
Open diff view settings
Collapse file

‎test/message/testcfg.py‎

Copy file name to clipboardExpand all lines: test/message/testcfg.py
+12-11Lines changed: 12 additions & 11 deletions
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

Collapse file

‎test/pseudo-tty/testcfg.py‎

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