X-Git-Url: http://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=ctypescrypto%2Frand.py;fp=ctypescrypto%2Frand.py;h=e179212a24480c08bd231e7b8ba82bf7513e6b24;hb=305f347018c18fa4183f8ec76177336881b713c9;hp=d9e966d67c67f6635751ce54338990ae788915eb;hpb=952f64afcfc4663797bf6cb36220e9c0e5116c17;p=oss%2Fctypescrypto.git diff --git a/ctypescrypto/rand.py b/ctypescrypto/rand.py index d9e966d..e179212 100644 --- a/ctypescrypto/rand.py +++ b/ctypescrypto/rand.py @@ -3,7 +3,7 @@ """ from ctypes import create_string_buffer, c_char_p, c_int, c_double -from ctypescrypto import libcrypto +from ctypescrypto import libcrypto, bintype from ctypescrypto.exception import LibCryptoError __all__ = ['RandError', 'bytes', 'pseudo_bytes', 'seed', 'status'] @@ -48,7 +48,7 @@ def seed(data, entropy=None): If entropy is not None, it should be floating point(double) value estimating amount of entropy in the data (in bytes). """ - if not isinstance(data, str): + if not isinstance(data, bintype): raise TypeError("A string is expected") ptr = c_char_p(data) size = len(data)