Skip to content

Commit 671dadd

Browse files
author
Siva Chandra
committedOct 23, 2015
[TestBreakpointCommand] Fix after r251121
Summary: "from __future__ import print_function" was added to the test file but not to the embedded interpreter. This change uses file.write instead to avoid all problems with print. Reviewers: zturner Subscribers: zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D14029 llvm-svn: 251150
1 parent 7009cd3 commit 671dadd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

Diff for: ‎lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def breakpoint_command_sequence(self):
5252

5353
# Now add callbacks for the breakpoints just created.
5454
self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4")
55-
self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2")
55+
self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); here.write(\"lldb\\n\"); here.close()' 2")
5656
self.runCmd("breakpoint command add --python-function bktptcmd.function 3")
5757

5858
# Check that the breakpoint commands are correctly set.
@@ -74,7 +74,7 @@ def breakpoint_command_sequence(self):
7474
self.expect("breakpoint command list 2", "Breakpoint 2 command ok",
7575
substrs = ["Breakpoint commands:",
7676
"here = open",
77-
"print(file=here)",
77+
"here.write",
7878
"here.close()"])
7979
self.expect("breakpoint command list 3", "Breakpoint 3 command ok",
8080
substrs = ["Breakpoint commands:",
@@ -178,7 +178,7 @@ def breakpoint_command_script_parameters (self):
178178
lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
179179

180180
# Now add callbacks for the breakpoints just created.
181-
self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, file=here); here.close()' 1")
181+
self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); here.write(str(frame) + \"\\n\"); here.write(str(bp_loc) + \"\\n\"); here.close()' 1")
182182

183183
# Remove 'output-2.txt' if it already exists.
184184

0 commit comments

Comments
 (0)
Please sign in to comment.