From 8a1de8d6cb5656f335b49fa9f4159f82f51e374a Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 6 Jul 2017 22:40:07 -0400 Subject: Fixed #631 -- deprecate all of OpenSSL.rand (#658) * Fixed #631 -- deprecate all of OpenSSL.rand * syntax fix * flake8 --- src/OpenSSL/rand.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/OpenSSL/rand.py') diff --git a/src/OpenSSL/rand.py b/src/OpenSSL/rand.py index cf2053f..e2f6373 100644 --- a/src/OpenSSL/rand.py +++ b/src/OpenSSL/rand.py @@ -2,6 +2,7 @@ PRNG management routines, thin wrappers. """ +import warnings from functools import partial from six import integer_types as _integer_types @@ -13,6 +14,12 @@ from OpenSSL._util import ( path_string as _path_string) +warnings.warn( + "OpenSSL.rand is deprecated - you should use os.urandom instead", + DeprecationWarning, stacklevel=3 +) + + class Error(Exception): """ An error occurred in an :mod:`OpenSSL.rand` API. -- cgit v1.2.1