Skip to content

Commit

Permalink
Fixed #631 -- deprecate all of OpenSSL.rand (#658)
Browse files Browse the repository at this point in the history
* Fixed #631 -- deprecate all of OpenSSL.rand

* syntax fix

* flake8
  • Loading branch information
alex authored and reaperhulk committed Jul 7, 2017
1 parent a421276 commit 8a1de8d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 43 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Backward-incompatible changes:
Deprecations:
^^^^^^^^^^^^^

*none*
- Deprecated ``OpenSSL.rand`` - callers should use ``os.urandom()`` instead.
`#658 <https://github.com/pyca/pyopenssl/pull/658>`_


Changes:
Expand Down
1 change: 0 additions & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ OpenSSL library. The following modules are defined:
:maxdepth: 2

api/crypto
api/rand
api/ssl
41 changes: 0 additions & 41 deletions doc/api/rand.rst

This file was deleted.

7 changes: 7 additions & 0 deletions src/OpenSSL/rand.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
PRNG management routines, thin wrappers.
"""

import warnings
from functools import partial

from six import integer_types as _integer_types
Expand All @@ -13,6 +14,12 @@
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.
Expand Down

0 comments on commit 8a1de8d

Please sign in to comment.