[Lldb-commits] [PATCH] D39199: [lldbtests] Handle errors instead of crashing

Davide Italiano via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 23 16:18:26 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL316393: [lldbtests] Handle errors instead of crashing. (authored by davide).

Changed prior to commit:
  https://reviews.llvm.org/D39199?vs=119917&id=119965#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39199

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


Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -50,7 +50,11 @@
 
 
 def is_exe(fpath):
-    """Returns true if fpath is an executable."""
+    """Returns true if fpath is an executable.
+       Exits with an error code if the specified path is invalid"""
+    if not os.path.exists(fpath):
+        print(fpath  + " is not a valid path, exiting")
+        sys.exit(-1)
     return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39199.119965.patch
Type: text/x-patch
Size: 632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171023/e50348fd/attachment.bin>


More information about the lldb-commits mailing list