summaryrefslogtreecommitdiff
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2012-05-10 17:21:23 -0700
committerNed Deily <nad@acm.org>2012-05-10 17:21:23 -0700
commit8c46a99e0bd614c49b303ce0e3161511891c5831 (patch)
tree131c2e0711cdc006d23a7ffa865459f2f9521abc /Lib/shutil.py
parent844dac804c8fa57b292a0cd5e1f87bfd08f79d0b (diff)
downloadcpython-8c46a99e0bd614c49b303ce0e3161511891c5831.tar.gz
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 d1b1af3246..2d7a506b2e 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):