diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-19 21:21:49 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-19 21:21:49 (GMT) |
commit | 9eb57c5fa50ed2f57d9320bb575371868316b5f2 (patch) | |
tree | 8b3efac8aade853f1d94105eced8313e4bb11e23 /Lib | |
parent | 79d68f929d8def878766965f513b628023f809b5 (diff) | |
download | cpython-9eb57c5fa50ed2f57d9320bb575371868316b5f2.zip cpython-9eb57c5fa50ed2f57d9320bb575371868316b5f2.tar.gz cpython-9eb57c5fa50ed2f57d9320bb575371868316b5f2.tar.bz2 |
Issue #22181: The availability of the getrandom() is now checked in configure,
and stored in pyconfig.h as the new HAVE_GETRANDOM_SYSCALL define.
Fix os.urandom() tests using file descriptors if os.urandom() uses getrandom().
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_os.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index ab0fe94..70734ab 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1199,9 +1199,12 @@ class URandomTests(unittest.TestCase): HAVE_GETENTROPY = (sysconfig.get_config_var('HAVE_GETENTROPY') == 1) +HAVE_GETRANDOM = (sysconfig.get_config_var('HAVE_GETRANDOM_SYSCALL') == 1) @unittest.skipIf(HAVE_GETENTROPY, "getentropy() does not use a file descriptor") +@unittest.skipIf(HAVE_GETRANDOM, + "getrandom() does not use a file descriptor") class URandomFDTests(unittest.TestCase): @unittest.skipUnless(resource, "test requires the resource module") def test_urandom_failure(self): |