1. Ned Batchelder
  2. coverage.py

Commits

Ned Batchelder  committed ea1a514

Removing a directory shouldn't panic if the directory doesn't exist.

  • Participants
  • Parent commits db8f7f7
  • Branches default

Comments (0)

Files changed (1)

File test/test_farm.py

View file
     def copy(self, src, dst):
         """Copy a directory."""
 
-        shutil.rmtree(dst, ignore_errors=True)
+        if os.path.exists(dst):
+            shutil.rmtree(dst)
         shutil.copytree(src, dst)
 
     def run(self, cmds, rundir="src"):
         assert not right_only, "Files in %s only: %s" % (dir2, right_only)
 
     def clean(self, cleandir):
-        shutil.rmtree(cleandir)
+        if os.path.exists(cleandir):
+            shutil.rmtree(cleandir)
 
 
 # So that we can run just one farm run.py at a time.