summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lldbtest.py
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-01-10 19:06:46 +0000
committerAdrian Prantl <aprantl@apple.com>2019-01-10 19:06:46 +0000
commit5ea5231bec86d9ee7af4d503f0ae0dba4bbf68bd (patch)
treec2bbab192c66c5abf0833a3fc6820411dc33c581 /lldb/packages/Python/lldbsuite/test/lldbtest.py
parent844f989608e01402954d7ceb9159c1a31da81910 (diff)
downloadbcm5719-llvm-5ea5231bec86d9ee7af4d503f0ae0dba4bbf68bd.tar.gz
bcm5719-llvm-5ea5231bec86d9ee7af4d503f0ae0dba4bbf68bd.zip
lldbtest.py: try to fix a runtime exception
found on http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/32/consoleFull#15046896708254eaf0-7326-4999-85b0-388101f2d404 llvm-svn: 350876
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index e689d65e7b5..161e8c61349 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1219,12 +1219,15 @@ class Base(unittest2.TestCase):
if os.path.isfile(src):
dst = src.replace(self.log_basename, dst_log_basename)
if os.name == "nt" and os.path.isfile(dst):
- # On Windows, renaming a -> b will throw an exception if b exists. On non-Windows platforms
- # it silently replaces the destination. Ultimately this means that atomic renames are not
- # guaranteed to be possible on Windows, but we need this to work anyway, so just remove the
- # destination first if it already exists.
+ # On Windows, renaming a -> b will throw an exception if
+ # b exists. On non-Windows platforms it silently
+ # replaces the destination. Ultimately this means that
+ # atomic renames are not guaranteed to be possible on
+ # Windows, but we need this to work anyway, so just
+ # remove the destination first if it already exists.
remove_file(dst)
+ lldbutil.mkdir_p(os.path.dirname(dst))
os.rename(src, dst)
else:
# success! (and we don't want log files) delete log files
OpenPOWER on IntegriCloud