Fix the following error when importing crashlog.py from a Python interactive session:

AttributeError: 'module' object has no attribute 'debugger'

llvm-svn: 156115
This commit is contained in:
Johnny Chen
2012-05-03 22:31:30 +00:00
parent a46e62424b
commit 356782f5f6

View File

@@ -469,7 +469,7 @@ if __name__ == '__main__':
# Create a new debugger instance
lldb.debugger = lldb.SBDebugger.Create()
SymbolicateCrashLog (sys.argv[1:])
elif lldb.debugger:
elif getattr(lldb, 'debugger', None):
lldb.debugger.HandleCommand('command script add -f lldb.macosx.crashlog.Symbolicate crashlog')
print '"crashlog" command installed, type "crashlog --help" for detailed help'