[Lldb-commits] [lldb] r176059 - Being explicit about how ignoring optparse's exceptions is not a best principle

Enrico Granata egranata at apple.com
Mon Feb 25 15:01:08 PST 2013


Author: enrico
Date: Mon Feb 25 17:01:08 2013
New Revision: 176059

URL: http://llvm.org/viewvc/llvm-project?rev=176059&view=rev
Log:
Being explicit about how ignoring optparse's exceptions is not a best principle

Modified:
    lldb/trunk/examples/python/cmdtemplate.py

Modified: lldb/trunk/examples/python/cmdtemplate.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/cmdtemplate.py?rev=176059&r1=176058&r2=176059&view=diff
==============================================================================
--- lldb/trunk/examples/python/cmdtemplate.py (original)
+++ lldb/trunk/examples/python/cmdtemplate.py Mon Feb 25 17:01:08 2013
@@ -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
     





More information about the lldb-commits mailing list