mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +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
1682e5d740
commit
5fddf866d8
3 changed files with 37 additions and 2 deletions
|
|
@ -118,8 +118,10 @@ def copystat(src, dst):
|
|||
try:
|
||||
os.chflags(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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue