diff options
author | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2014-01-09 14:33:42 -0500 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2014-01-09 14:33:42 -0500 |
commit | e80a25a416a8fca15738e48110aaf5321ed3fe68 (patch) | |
tree | 9c5fe76ea01d7e68bb8c1ffd7adab5fe39791b44 | |
parent | c17803496a51f4c4e18ea09b5328eebdb92feb1f (diff) | |
download | pyopenssl-e80a25a416a8fca15738e48110aaf5321ed3fe68.tar.gz |
this __builtin__ thing is not Python 3 compatible, apparently
-rw-r--r-- | OpenSSL/rand.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenSSL/rand.py b/OpenSSL/rand.py index 9be14ec..cddfd2d 100644 --- a/OpenSSL/rand.py +++ b/OpenSSL/rand.py @@ -4,8 +4,6 @@ PRNG management routines, thin wrappers. See the file RATIONALE for a short explanation of why this module was written. """ -import __builtin__ - from functools import partial from OpenSSL._util import ( @@ -23,6 +21,8 @@ _raise_current_error = partial(_exception_from_error_queue, Error) _unspecified = object() +_builtin_bytes = bytes + def bytes(num_bytes): """ Get some random bytes as a string. @@ -55,7 +55,7 @@ def add(buffer, entropy): :param entropy: The entropy (in bytes) measurement of the buffer :return: None """ - if not isinstance(buffer, __builtin__.bytes): + if not isinstance(buffer, _builtin_bytes): raise TypeError("buffer must be a byte string") if not isinstance(entropy, int): @@ -73,7 +73,7 @@ def seed(buffer): :param buffer: Buffer with random data :return: None """ - if not isinstance(buffer, __builtin__.bytes): + if not isinstance(buffer, _builtin_bytes): raise TypeError("buffer must be a byte string") # TODO Nothing tests this call actually being made, or made properly. |