[3.14] gh-127146: Emscripten: Fix test failure due to missing os.link (GH-135626) (#135652)

Check for existence of os.link, rather than assuming it exists.
(cherry picked from commit ce58afb400)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-06-18 06:03:32 +02:00 committed by GitHub
parent bf189d7ab5
commit a61bd7af6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5875,9 +5875,9 @@ class TestSignatureDefinitions(unittest.TestCase):
self._test_module_has_signatures(operator)
def test_os_module_has_signatures(self):
unsupported_signature = {'chmod', 'link', 'utime'}
unsupported_signature = {'chmod', 'utime'}
unsupported_signature |= {name for name in
['get_terminal_size', 'posix_spawn', 'posix_spawnp',
['get_terminal_size', 'link', 'posix_spawn', 'posix_spawnp',
'register_at_fork', 'startfile']
if hasattr(os, name)}
self._test_module_has_signatures(os, unsupported_signature=unsupported_signature)