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

@ -290,10 +290,8 @@ def copymode(src, dst, *, follow_symlinks=True):
stat_func, chmod_func = os.lstat, os.lchmod
else:
return
elif hasattr(os, 'chmod'):
stat_func, chmod_func = _stat, os.chmod
else:
return
stat_func, chmod_func = _stat, os.chmod
st = stat_func(src)
chmod_func(dst, stat.S_IMODE(st.st_mode))