]> www.wagner.pp.ru Git - oss/ctypescrypto.git/blobdiff - ctypescrypto/rand.py
Covered StackOfX509 by tests, fixed some typos in pkey docstrings
[oss/ctypescrypto.git] / ctypescrypto / rand.py
index f14c6f769836d76126b402c628829b46d9548b3d..4bc073a1ceb63f727d6022e5586d85d577084dbf 100644 (file)
@@ -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)