]> granicus.if.org Git - python/commitdiff
Don't fail if the directory already exists
authorNeal Norwitz <nnorwitz@gmail.com>
Sat, 22 Jul 2006 17:00:57 +0000 (17:00 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sat, 22 Jul 2006 17:00:57 +0000 (17:00 +0000)
Lib/test/test_filecmp.py

index c54119c2979896318ee173771e732fac0c84755a..503562b615133d0101ae7290e229061eac98cdcc 100644 (file)
@@ -1,5 +1,5 @@
 
-import os, filecmp, shutil, tempfile
+import os, filecmp, shutil, tempfile, shutil
 import unittest
 from test import test_support
 
@@ -49,6 +49,7 @@ class DirCompareTestCase(unittest.TestCase):
         self.caseinsensitive = os.path.normcase('A') == os.path.normcase('a')
         data = 'Contents of file go here.\n'
         for dir in [self.dir, self.dir_same, self.dir_diff]:
+            shutil.rmtree(dir, True)
             os.mkdir(dir)
             if self.caseinsensitive and dir is self.dir_same:
                 fn = 'FiLe'     # Verify case-insensitive comparison