summaryrefslogtreecommitdiff
path: root/Lib/test/libregrtest
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2019-02-25 14:32:27 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2019-02-25 23:32:27 +0100
commit8377cd4fcd0d51d86834c9b0518d29aac3b49e18 (patch)
treee8d82c3567b2d39ff0bd285d25ce2d02359ae070 /Lib/test/libregrtest
parent9c3f284de598550be6687964c23fd7599e53b20e (diff)
downloadcpython-git-8377cd4fcd0d51d86834c9b0518d29aac3b49e18.tar.gz
Clean up code which checked presence of os.{stat,lstat,chmod} (#11643)
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r--Lib/test/libregrtest/runtest.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py
index dc2abf237b..4f218b769f 100644
--- a/Lib/test/libregrtest/runtest.py
+++ b/Lib/test/libregrtest/runtest.py
@@ -249,10 +249,8 @@ 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)
+ # fix possible permissions problems that might prevent cleanup
+ os.chmod(name, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
nuker(name)
except Exception as msg:
print(("%r left behind %s %r and it couldn't be "