summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-04-29 22:44:15 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-04-29 22:44:15 (GMT)
commita9b4d4777a4018e7fcaa92b6e587992819501b5e (patch)
treeb472ffccca0f2d0814b31ca2f25b94f1a9aaa763 /Lib/test
parent8c5326f103d1b71aac293815f0f731d756c1a90a (diff)
downloadcpython-a9b4d4777a4018e7fcaa92b6e587992819501b5e.zip
cpython-a9b4d4777a4018e7fcaa92b6e587992819501b5e.tar.gz
cpython-a9b4d4777a4018e7fcaa92b6e587992819501b5e.tar.bz2
make sure mode is removable while cleaning up test droppings
Diffstat (limited to 'Lib/test')
-rwxr-xr-xLib/test/regrtest.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index fe7f347..dc86a74 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -620,6 +620,7 @@ def runtest_inner(test, verbose, quiet, test_times,
def cleanup_test_droppings(testname, verbose):
import shutil
+ import stat
# Try to clean up junk commonly left behind. While tests shouldn't leave
# any files or directories behind, when a test fails that can be tedious
@@ -644,6 +645,10 @@ def cleanup_test_droppings(testname, verbose):
if verbose:
print "%r left behind %s %r" % (testname, kind, name)
try:
+ # if we have chmod, fix possible permissions problems
+ # that might prevent cleanup
+ if (hasattr(os, 'chmod')):
+ os.chmod(name, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
nuker(name)
except Exception, msg:
print >> sys.stderr, ("%r left behind %s %r and it couldn't be "