[Lldb-commits] [lldb] r340791 - Add a mkdir -p to builddir into lldbtest.py
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Mon Aug 27 16:06:37 PDT 2018
Author: adrian
Date: Mon Aug 27 16:06:37 2018
New Revision: 340791
URL: http://llvm.org/viewvc/llvm-project?rev=340791&view=rev
Log:
Add a mkdir -p to builddir into lldbtest.py
Based on how it is executed, it may not have been yet created.
Modified:
lldb/trunk/lit/Suite/lldbtest.py
Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=340791&r1=340790&r2=340791&view=diff
==============================================================================
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Mon Aug 27 16:06:37 2018
@@ -18,6 +18,16 @@ def getBuildDir(cmd):
found = True
return None
+def mkdir_p(path):
+ import errno
+ try:
+ os.makedirs(path)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise
+ if not os.path.isdir(path):
+ raise OSError(errno.ENOTDIR, "%s is not a directory"%path)
+
class LLDBTest(TestFormat):
def __init__(self, dotest_cmd):
self.dotest_cmd = dotest_cmd
@@ -64,6 +74,7 @@ class LLDBTest(TestFormat):
sys.executable.startswith('/System/'):
builddir = getBuildDir(cmd)
assert(builddir)
+ mkdir_p(builddir)
copied_python = os.path.join(builddir, 'copied-system-python')
import shutil
shutil.copy(sys.executable, os.path.join(builddir, copied_python))
More information about the lldb-commits
mailing list