Issue #14662: Prevent shutil failures on OS X when destination does not

support chflag operations.  (Patch by Hynek Schlawack)
This commit is contained in:
Ned Deily 2012-05-10 17:05:19 -07:00
parent 569d087574
commit baf75713c7
3 changed files with 36 additions and 2 deletions

View file

@ -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):