when built on non-Windows system without fd system call support,
like older versions of macOS.
(cherry picked from commit
7fcc2088a50a4ecb80e5644cd195bee209c9f979)
Co-authored-by: Ned Deily <nad@python.org>
ignore_dangling_symlinks=ignore_dangling_symlinks,
dirs_exist_ok=dirs_exist_ok)
-if hasattr(stat, 'FILE_ATTRIBUTE_REPARSE_POINT'):
+if hasattr(os.stat_result, 'st_file_attributes'):
# Special handling for directory junctions to make them behave like
# symlinks for shutil.rmtree, since in general they do not appear as
# regular links.
--- /dev/null
+Prevent shutil.rmtree exception when built on non-Windows system without fd
+system call support, like older versions of macOS.