[3.13] gh-123797: Check for runtime availability of ptsname_r on macos (GH-123806) (#124270)

gh-123797: Check for runtime availability of `ptsname_r` on macos (GH-123806)
(cherry picked from commit 3e36e5aef1)

Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2024-09-30 03:06:53 +02:00 committed by GitHub
parent dddae6647e
commit dbfc37a5f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 10 deletions

View file

@ -2140,6 +2140,13 @@ class TestPosixWeaklinking(unittest.TestCase):
with self.assertRaisesRegex(NotImplementedError, "dir_fd unavailable"):
os.stat("file", dir_fd=0)
def test_ptsname_r(self):
self._verify_available("HAVE_PTSNAME_R")
if self.mac_ver >= (10, 13, 4):
self.assertIn("HAVE_PTSNAME_R", posix._have_functions)
else:
self.assertNotIn("HAVE_PTSNAME_R", posix._have_functions)
def test_access(self):
self._verify_available("HAVE_FACCESSAT")
if self.mac_ver >= (10, 10):