diff options
author | Ned Deily <nad@acm.org> | 2012-05-10 17:45:49 -0700 |
---|---|---|
committer | Ned Deily <nad@acm.org> | 2012-05-10 17:45:49 -0700 |
commit | acdc56d0d0ccea89d219d126c3ca1b9a28456bd5 (patch) | |
tree | dfd3900dbe714784a2f187bb6887255c9894d514 /Lib/shutil.py | |
parent | b79a01f9046ef0659eb9e68811ac0af4af7e16f4 (diff) | |
download | cpython-git-acdc56d0d0ccea89d219d126c3ca1b9a28456bd5.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.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index be83251104..dca4d2efeb 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -102,8 +102,10 @@ def copystat(src, dst): try: os.chflags(dst, st.st_flags) except OSError, 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): |