Clean up code which checked presence of os.{stat,lstat,chmod} (#11643)

This commit is contained in:
Anthony Sottile 2019-02-25 14:32:27 -08:00 committed by Giampaolo Rodola
parent 9c3f284de5
commit 8377cd4fcd
18 changed files with 21 additions and 70 deletions

View file

@ -2266,7 +2266,6 @@ class PyBuildInstallLib(install_lib):
return outfiles
def set_file_modes(self, files, defaultMode, sharedLibMode):
if not self.is_chmod_supported(): return
if not files: return
for filename in files:
@ -2277,16 +2276,12 @@ class PyBuildInstallLib(install_lib):
if not self.dry_run: os.chmod(filename, mode)
def set_dir_modes(self, dirname, mode):
if not self.is_chmod_supported(): return
for dirpath, dirnames, fnames in os.walk(dirname):
if os.path.islink(dirpath):
continue
log.info("changing mode of %s to %o", dirpath, mode)
if not self.dry_run: os.chmod(dirpath, mode)
def is_chmod_supported(self):
return hasattr(os, 'chmod')
class PyBuildScripts(build_scripts):
def copy_scripts(self):
outfiles, updated_files = build_scripts.copy_scripts(self)