summaryrefslogtreecommitdiff
path: root/src/OpenSSL/rand.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2017-07-06 22:40:07 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2017-07-06 21:40:07 -0500
commit8a1de8d6cb5656f335b49fa9f4159f82f51e374a (patch)
tree78146e50edebcd3bd11da380322006c0e11b3e0c /src/OpenSSL/rand.py
parenta421276a6887bc905f4c3ae964844d418216c946 (diff)
downloadpyopenssl-8a1de8d6cb5656f335b49fa9f4159f82f51e374a.tar.gz
Fixed #631 -- deprecate all of OpenSSL.rand (#658)
* Fixed #631 -- deprecate all of OpenSSL.rand * syntax fix * flake8
Diffstat (limited to 'src/OpenSSL/rand.py')
-rw-r--r--src/OpenSSL/rand.py7
1 files changed, 7 insertions, 0 deletions
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.