[3.12] gh-113090: Fix test.support.os_support.can_chmod() on Windows (GH-113091) (GH-113099)

(cherry picked from commit c6e953be12)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2023-12-14 13:00:40 +01:00 committed by GitHub
parent 9f5209f3c2
commit 913051d2a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View file

@ -3429,7 +3429,7 @@ class TestExtractionFilters(unittest.TestCase):
path = pathlib.Path(os.path.normpath(self.destdir / name))
self.assertIn(path, self.expected_paths)
self.expected_paths.remove(path)
if mode is not None and os_helper.can_chmod():
if mode is not None and os_helper.can_chmod() and os.name != 'nt':
got = stat.filemode(stat.S_IMODE(path.stat().st_mode))
self.assertEqual(got, mode)
if type is None and isinstance(name, str) and name.endswith('/'):