[Python-checkins] devinabox: Use shutil.rmtree() over os.rmdir() in case the tests get messy.

brett.cannon python-checkins at python.org
Wed Mar 2 21:47:23 CET 2011


http://hg.python.org/devinabox/rev/830522cad268
changeset:   36:830522cad268
user:        Brett Cannon <brett at python.org>
date:        Wed Mar 02 12:46:32 2011 -0800
summary:
  Use shutil.rmtree() over os.rmdir() in case the tests get messy.

files:
  make_a_box.py
  run_all_tests.py

diff --git a/make_a_box.py b/make_a_box.py
--- a/make_a_box.py
+++ b/make_a_box.py
@@ -18,6 +18,7 @@
 import operator
 import os
 import os.path
+import shutil
 import subprocess
 import sys
 import urllib.request
@@ -150,7 +151,7 @@
                                    regrtest_path])
         finally:
             # Clean up from the test run
-            os.rmdir('build')
+            shutil.rmtree('build')
         # Generate the HTML report
         print('Generating report ...')
         subprocess.call([executable, 'coveragepy', 'html', '-i', '--omit',
diff --git a/run_all_tests.py b/run_all_tests.py
--- a/run_all_tests.py
+++ b/run_all_tests.py
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 """Run CPython's test suite in the most rigorous way possible."""
 import multiprocessing
+import shutil
 import subprocess
 import sys
 import build_cpython
@@ -16,7 +17,7 @@
                          '-w', '-u', 'all', '-j',
                          str(multiprocessing.cpu_count())])
     finally:
-        os.rmdir('build')
+        shutil.rmtree('build')
 
 
 if __name__ == '__main__':

-- 
Repository URL: http://hg.python.org/devinabox


More information about the Python-checkins mailing list