]> www.wagner.pp.ru Git - oss/ctypescrypto.git/blobdiff - ctypescrypto/__init__.py
Begin to implement python3 support. Now tests for oid, bio, cipher, digest, mac and...
[oss/ctypescrypto.git] / ctypescrypto / __init__.py
index a63fed425bdd9abe07d09ce915bb17030968f376..e9d9f1410b8c0a4a9c5ab257eeb0e1645ebca738 100644 (file)
@@ -30,6 +30,15 @@ if __libname__ is None:
 
 libcrypto = CDLL(__libname__)
 libcrypto.OPENSSL_config.argtypes = (c_char_p, )
+pyver=int(sys.version[0])
+if pyver == 2:
+    bintype = str
+    chartype = unicode
+    inttype = (int, long)
+else:
+    bintype = bytes
+    chartype = str
+    inttype = int
 
 if hasattr(libcrypto,'OPENSSL_init_crypto'):
     libcrypto.OPENSSL_init_crypto.argtypes = (c_uint64,c_void_p)