mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
Issue #14662: Prevent shutil failures on OS X when destination does not
support chflag operations. (Patch by Hynek Schlawack)
This commit is contained in:
parent
b79a01f904
commit
acdc56d0d0
4 changed files with 40 additions and 2 deletions
|
|
@ -102,8 +102,10 @@ def copystat(src, dst):
|
|||
try:
|
||||
os.chflags(dst, st.st_flags)
|
||||
except OSError, why:
|
||||
if (not hasattr(errno, 'EOPNOTSUPP') or
|
||||
why.errno != errno.EOPNOTSUPP):
|
||||
for err in 'EOPNOTSUPP', 'ENOTSUP':
|
||||
if hasattr(errno, err) and why.errno == getattr(errno, err):
|
||||
break
|
||||
else:
|
||||
raise
|
||||
|
||||
def copy(src, dst):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue