summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2012-05-11 00:21:23 (GMT)
committerNed Deily <nad@acm.org>2012-05-11 00:21:23 (GMT)
commit5fddf866d8cbd03f400cce3958a9ca10b9095332 (patch)
tree0aff77af5b790c3a442a070592da83f4cfd0a355 /Lib/shutil.py
parent1682e5d74080d88109b3fc54e2ddfa762feb3e1d (diff)
downloadcpython-5fddf866d8cbd03f400cce3958a9ca10b9095332.zip
cpython-5fddf866d8cbd03f400cce3958a9ca10b9095332.tar.gz
cpython-5fddf866d8cbd03f400cce3958a9ca10b9095332.tar.bz2
Issue #14662: Prevent shutil failures on OS X when destination does not
support chflag operations. (Patch by Hynek Schlawack)
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index d1b1af3..2d7a506 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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):