diff options
| author | Ned Deily <nad@acm.org> | 2012-05-10 17:21:23 -0700 |
|---|---|---|
| committer | Ned Deily <nad@acm.org> | 2012-05-10 17:21:23 -0700 |
| commit | 5fddf866d8cbd03f400cce3958a9ca10b9095332 (patch) | |
| tree | 0aff77af5b790c3a442a070592da83f4cfd0a355 /Lib/shutil.py | |
| parent | 1682e5d74080d88109b3fc54e2ddfa762feb3e1d (diff) | |
| download | cpython-git-5fddf866d8cbd03f400cce3958a9ca10b9095332.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 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): |
