[PATCH] D74548: [debuginfo-tests][Dexter] Downgrade failure to delete working dir to warning not error

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 05:18:14 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0a3b0837915e: [debuginfo-tests] Warn, not error, if we can't delete working directory (authored by jmorse).

Changed prior to commit:
  https://reviews.llvm.org/D74548?vs=244418&id=246421#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74548/new/

https://reviews.llvm.org/D74548

Files:
  debuginfo-tests/dexter/dex/utils/WorkingDirectory.py


Index: debuginfo-tests/dexter/dex/utils/WorkingDirectory.py
===================================================================
--- debuginfo-tests/dexter/dex/utils/WorkingDirectory.py
+++ debuginfo-tests/dexter/dex/utils/WorkingDirectory.py
@@ -12,7 +12,7 @@
 import time
 
 from dex.utils.Exceptions import Error
-
+from dex.utils.Warning import warn
 
 class WorkingDirectory(object):
     def __init__(self, context, *args, **kwargs):
@@ -35,12 +35,12 @@
                 self.path))
             return
 
-        exception = AssertionError('should never be raised')
         for _ in range(100):
             try:
                 shutil.rmtree(self.path)
                 return
-            except OSError as e:
-                exception = e
+            except OSError:
                 time.sleep(0.1)
-        raise Error(exception)
+
+        warn(self.context, '"{}" left in place (couldn\'t delete)\n'.format(self.path))
+        return


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74548.246421.patch
Type: text/x-patch
Size: 952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200225/4d4f2767/attachment.bin>


More information about the llvm-commits mailing list