From 1fb7c625d06d7ce49bd179c35c6414388f060d34 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 7 Mar 2013 02:58:47 +0000 Subject: [PATCH] Stop the "module" property from throwing an exception when the module name was not found in the target module list. llvm-svn: 176611 --- lldb/scripts/Python/interface/SBTarget.i | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lldb/scripts/Python/interface/SBTarget.i b/lldb/scripts/Python/interface/SBTarget.i index 4e3161eedf90..8f9ea2ee6396 100644 --- a/lldb/scripts/Python/interface/SBTarget.i +++ b/lldb/scripts/Python/interface/SBTarget.i @@ -751,12 +751,15 @@ public: 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) -- 2.34.1