summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-02-25 23:01:08 +0000
committerEnrico Granata <egranata@apple.com>2013-02-25 23:01:08 +0000
commit6308f58254bd04d4e118425ad962b352167d99ba (patch)
tree3c1c9ff4fa1871fea4e31e9db17ad39283fceada /lldb/examples/python
parentab976680615b88b6a2bdccad3930fdf6f8d889ca (diff)
downloadbcm5719-llvm-6308f58254bd04d4e118425ad962b352167d99ba.tar.gz
bcm5719-llvm-6308f58254bd04d4e118425ad962b352167d99ba.zip
Being explicit about how ignoring optparse's exceptions is not a best principle
llvm-svn: 176059
Diffstat (limited to 'lldb/examples/python')
-rw-r--r--lldb/examples/python/cmdtemplate.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/examples/python/cmdtemplate.py b/lldb/examples/python/cmdtemplate.py
index dc8e6b10664..9936d0e68e2 100644
--- a/lldb/examples/python/cmdtemplate.py
+++ b/lldb/examples/python/cmdtemplate.py
@@ -38,6 +38,8 @@ def ls(debugger, command, result, dict):
try:
(options, args) = parser.parse_args(command_args)
except:
+ # if you don't handle exceptions, passing an incorrect argument to the OptionParser will cause LLDB to exit
+ # (courtesy of OptParse dealing with argument errors by throwing SystemExit)
result.SetStatus (lldb.eReturnStatusFailed)
return
OpenPOWER on IntegriCloud