mirror of
https://github.com/python/cpython.git
synced 2025-08-17 07:11:51 +00:00
[3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603)
when built on non-Windows system without fd system call support,
like older versions of macOS.
(cherry picked from commit 7fcc2088a5
)
Co-authored-by: Ned Deily <nad@python.org>
This commit is contained in:
parent
96631dcb11
commit
25a044ee6c
2 changed files with 3 additions and 1 deletions
|
@ -544,7 +544,7 @@ def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2,
|
||||||
ignore_dangling_symlinks=ignore_dangling_symlinks,
|
ignore_dangling_symlinks=ignore_dangling_symlinks,
|
||||||
dirs_exist_ok=dirs_exist_ok)
|
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
|
# Special handling for directory junctions to make them behave like
|
||||||
# symlinks for shutil.rmtree, since in general they do not appear as
|
# symlinks for shutil.rmtree, since in general they do not appear as
|
||||||
# regular links.
|
# regular links.
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Prevent shutil.rmtree exception when built on non-Windows system without fd
|
||||||
|
system call support, like older versions of macOS.
|
Loading…
Add table
Add a link
Reference in a new issue