mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue