From ddd72aac2945005763e2ff31eaf3fa0f5380c73f Mon Sep 17 00:00:00 2001 From: Vasiliy Kiryanov Date: Mon, 21 Sep 2026 09:38:50 -0400 Subject: [PATCH] gh-119048: Use shutil._use_fd_functions in test_rmtree_uses_safe_fd_version_if_available --- Lib/test/test_shutil.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 06ebdf9b68f20f..a7825adf923c19 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -552,11 +552,7 @@ def raiser(fn, *args, **kwargs): os.lstat = orig_lstat def test_rmtree_uses_safe_fd_version_if_available(self): - _use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} <= - os.supports_dir_fd and - os.listdir in os.supports_fd and - os.stat in os.supports_follow_symlinks) - if _use_fd_functions: + if shutil._use_fd_functions: self.assertTrue(shutil.rmtree.avoids_symlink_attacks) tmp_dir = self.mkdtemp() d = os.path.join(tmp_dir, 'a')