summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/test/functionalities/command_script/welcome.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lldb/test/functionalities/command_script/welcome.py b/lldb/test/functionalities/command_script/welcome.py
index c6d4ddcfd40..f7e6a7ebc74 100644
--- a/lldb/test/functionalities/command_script/welcome.py
+++ b/lldb/test/functionalities/command_script/welcome.py
@@ -16,11 +16,15 @@ class TargetnameCommand(object):
pass
def __call__(self, debugger, args, exe_ctx, result):
- target = debugger.GetSelectedTarget()
- file = target.GetExecutable()
- print >>result, ('Current target ' + file.GetFilename())
if args == 'fail':
result.SetError('a test for error in command')
+ return
+ target = debugger.GetSelectedTarget()
+ file = target.GetExecutable()
+ if file:
+ print >>result, ('Current target ' + file.GetFilename())
+ else:
+ result.SetError('target.GetExecutable() failed')
def get_flags(self):
return lldb.eCommandRequiresTarget
OpenPOWER on IntegriCloud