diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-01-28 19:39:06 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-01-28 19:39:06 +0000 |
commit | 49c22453549bfda8b1a2b6f9ea812e033a7164ad (patch) | |
tree | b75e7e734517c23fc16ae1961a87be48cb6ac6c8 /lldb/test/command_source/TestCommandSource.py | |
parent | c03a362b1666dad0b66040ac7cf77b3803fc4a09 (diff) | |
download | bcm5719-llvm-49c22453549bfda8b1a2b6f9ea812e033a7164ad.tar.gz bcm5719-llvm-49c22453549bfda8b1a2b6f9ea812e033a7164ad.zip |
The restoring of sys.stdout should happen right after:
self.runCmd("script my.date()")
In case the self.expect() fails, the restore would not be executed.
llvm-svn: 124500
Diffstat (limited to 'lldb/test/command_source/TestCommandSource.py')
-rw-r--r-- | lldb/test/command_source/TestCommandSource.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/test/command_source/TestCommandSource.py b/lldb/test/command_source/TestCommandSource.py index 0f34eb464a5..006967d49b6 100644 --- a/lldb/test/command_source/TestCommandSource.py +++ b/lldb/test/command_source/TestCommandSource.py @@ -29,14 +29,14 @@ class CommandSourceTestCase(TestBase): # Python should evaluate "my.date()" successfully. self.runCmd("script my.date()") + # Now restore stdout to the way we were. :-) + sys.stdout = old_stdout + import datetime self.expect(session.getvalue(), "script my.date() runs successfully", exe=False, substrs = [str(datetime.date.today())]) - # Now restore stdout to the way we were. :-) - sys.stdout = old_stdout - if __name__ == '__main__': import atexit |