[Lldb-commits] [lldb] r350876 - lldbtest.py: try to fix a runtime exception

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 10 11:06:46 PST 2019


Author: adrian
Date: Thu Jan 10 11:06:46 2019
New Revision: 350876

URL: http://llvm.org/viewvc/llvm-project?rev=350876&view=rev
Log:
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

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

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=350876&r1=350875&r2=350876&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Thu Jan 10 11:06:46 2019
@@ -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




More information about the lldb-commits mailing list