X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=ctypescrypto%2Frand.py;h=4bc073a1ceb63f727d6022e5586d85d577084dbf;hb=5eb6b4548beeacbd191b9c49a9b6cb7acf339837;hp=f14c6f769836d76126b402c628829b46d9548b3d;hpb=3af16f1cbc516e55cfc31af5dee0bc367a9ecbae;p=oss%2Fctypescrypto.git diff --git a/ctypescrypto/rand.py b/ctypescrypto/rand.py index f14c6f7..4bc073a 100644 --- a/ctypescrypto/rand.py +++ b/ctypescrypto/rand.py @@ -6,6 +6,8 @@ from ctypes import create_string_buffer, c_char_p, c_int, c_double from ctypescrypto import libcrypto from ctypescrypto.exception import LibCryptoError +__all__ = ['RandError','bytes','pseudo_bytes','seed','status'] + class RandError(LibCryptoError): pass @@ -45,7 +47,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 type(data) != type(""): + if not isinstance(data,str): raise TypeError("A string is expected") ptr = c_char_p(data) size = len(data)