[Lldb-commits] [lldb] r323566 - [lldbtestsuite] Don't crash on `None` input for is_exe().

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 26 13:46:10 PST 2018


Author: davide
Date: Fri Jan 26 13:46:10 2018
New Revision: 323566

URL: http://llvm.org/viewvc/llvm-project?rev=323566&view=rev
Log:
[lldbtestsuite] Don't crash on `None` input for is_exe().

Now the function returns `False`, and the caller can take the
appropriate action (in this case, for --executable, reporting
that the file doesn't exist).

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=323566&r1=323565&r2=323566&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Fri Jan 26 13:46:10 2018
@@ -51,6 +51,8 @@ from ..support import seven
 
 def is_exe(fpath):
     """Returns true if fpath is an executable."""
+    if fpath == None:
+      return False
     return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
 
 




More information about the lldb-commits mailing list