Issue #14662: Prevent shutil failures on OS X when destination does not
support chflag operations.  (Patch by Hynek Schlawack)
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 @@
         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):