Stop the "module" property from throwing an exception when the module name was not found in the target module list.
llvm-svn: 176611
diff --git a/lldb/scripts/Python/interface/SBTarget.i b/lldb/scripts/Python/interface/SBTarget.i
index 4e3161e..8f9ea2e 100644
--- a/lldb/scripts/Python/interface/SBTarget.i
+++ b/lldb/scripts/Python/interface/SBTarget.i
@@ -751,12 +751,15 @@
if module.file.fullpath == key:
return module
# See if the string is a UUID
- the_uuid = uuid.UUID(key)
- if the_uuid:
- for idx in range(num_modules):
- module = self.sbtarget.GetModuleAtIndex(idx)
- if module.uuid == the_uuid:
- return module
+ try:
+ the_uuid = uuid.UUID(key)
+ if the_uuid:
+ for idx in range(num_modules):
+ module = self.sbtarget.GetModuleAtIndex(idx)
+ if module.uuid == the_uuid:
+ return module
+ except:
+ return None
elif type(key) is uuid.UUID:
for idx in range(num_modules):
module = self.sbtarget.GetModuleAtIndex(idx)