mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +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
569d087574
commit
baf75713c7
3 changed files with 36 additions and 2 deletions
|
@ -160,8 +160,10 @@ def copystat(src, dst, symlinks=False):
|
|||
try:
|
||||
chflags_func(dst, st.st_flags)
|
||||
except OSError as 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, symlinks=False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue