[Lldb-commits] [lldb] r124500 - /lldb/trunk/test/command_source/TestCommandSource.py
Johnny Chen
johnny.chen at apple.com
Fri Jan 28 11:39:06 PST 2011
Author: johnny
Date: Fri Jan 28 13:39:06 2011
New Revision: 124500
URL: http://llvm.org/viewvc/llvm-project?rev=124500&view=rev
Log:
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.
Modified:
lldb/trunk/test/command_source/TestCommandSource.py
Modified: lldb/trunk/test/command_source/TestCommandSource.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/command_source/TestCommandSource.py?rev=124500&r1=124499&r2=124500&view=diff
==============================================================================
--- lldb/trunk/test/command_source/TestCommandSource.py (original)
+++ lldb/trunk/test/command_source/TestCommandSource.py Fri Jan 28 13:39:06 2011
@@ -29,14 +29,14 @@
# 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
More information about the lldb-commits
mailing list