[Python-checkins] r72133 - python/trunk/Lib/test/regrtest.py
benjamin.peterson
python-checkins at python.org
Thu Apr 30 00:44:15 CEST 2009
Author: benjamin.peterson
Date: Thu Apr 30 00:44:15 2009
New Revision: 72133
Log:
make sure mode is removable while cleaning up test droppings
Modified:
python/trunk/Lib/test/regrtest.py
Modified: python/trunk/Lib/test/regrtest.py
==============================================================================
--- python/trunk/Lib/test/regrtest.py (original)
+++ python/trunk/Lib/test/regrtest.py Thu Apr 30 00:44:15 2009
@@ -620,6 +620,7 @@
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 @@
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 "
More information about the Python-checkins
mailing list