summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2012-05-11 00:05:19 (GMT)
committerNed Deily <nad@acm.org>2012-05-11 00:05:19 (GMT)
commitbaf75713c76ee9b1c3213429d05c3a12adb447af (patch)
treea268824145e2dc07b36369ca76f4aeafaa0cbe48 /Lib/shutil.py
parent569d0875741df1ab196531fb4098b5e5e640aa61 (diff)
downloadcpython-baf75713c76ee9b1c3213429d05c3a12adb447af.zip
cpython-baf75713c76ee9b1c3213429d05c3a12adb447af.tar.gz
cpython-baf75713c76ee9b1c3213429d05c3a12adb447af.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 892a94c..9625d36 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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):