mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Clean up code which checked presence of os.{stat,lstat,chmod} (#11643)
This commit is contained in:
parent
9c3f284de5
commit
8377cd4fcd
18 changed files with 21 additions and 70 deletions
5
setup.py
5
setup.py
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue