[Lldb-commits] [lldb] r116643 - /lldb/trunk/test/lldbutil.py
Johnny Chen
johnny.chen at apple.com
Fri Oct 15 16:33:18 PDT 2010
Author: johnny
Date: Fri Oct 15 18:33:18 2010
New Revision: 116643
URL: http://llvm.org/viewvc/llvm-project?rev=116643&view=rev
Log:
Don't wrap StringIO inside a with statement. It is not a context manager.
Modified:
lldb/trunk/test/lldbutil.py
Modified: lldb/trunk/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=116643&r1=116642&r2=116643&view=diff
==============================================================================
--- lldb/trunk/test/lldbutil.py (original)
+++ lldb/trunk/test/lldbutil.py Fri Oct 15 18:33:18 2010
@@ -4,7 +4,7 @@
import lldb
import sys
-import cStringIO
+import StringIO
################################################
# #
@@ -167,7 +167,7 @@
def PrintStackTrace(thread, string_buffer = False):
"""Prints a simple stack trace of this thread."""
- output = cStringIO.StringIO() if string_buffer else sys.stdout
+ output = StringIO.StringIO() if string_buffer else sys.stdout
target = thread.GetProcess().GetTarget()
depth = thread.GetNumFrames()
@@ -196,14 +196,13 @@
num=i, addr=load_addr, mod=mods[i], func=funcs[i], file=files[i], line=lines[i])
if string_buffer:
- with output:
- return output.getvalue()
+ return output.getvalue()
def PrintStackTraces(process, string_buffer = False):
"""Prints the stack traces of all the threads."""
- output = cStringIO.StringIO() if string_buffer else sys.stdout
+ output = StringIO.StringIO() if string_buffer else sys.stdout
print >> output, "Stack traces for " + repr(process)
@@ -211,5 +210,4 @@
print >> output, PrintStackTrace(process.GetThreadAtIndex(i), string_buffer=True)
if string_buffer:
- with output:
- return output.getvalue()
+ return output.getvalue()
More information about the lldb-commits
mailing list