Use print() function in both Python 2 and Python 3

Legacy __print__ statements are syntax errors in Python 3 but __print()__ function works as expected in both Python 2 and Python 3.
This commit is contained in:
cclauss
2019-06-24 18:49:38 +02:00
parent b71ed3887e
commit 5bb6b58bc1
25 changed files with 353 additions and 328 deletions

View File

@@ -8,6 +8,7 @@
# pbkdf2.py Copyright © 2009 Daniel Holth <dholth@fastmail.fm>
# pbkdf2.py This code may be freely used and modified for any purpose.
from __future__ import print_function
import sys, os
import hmac
from struct import pack
@@ -158,7 +159,7 @@ def _load_libalfcrypto():
topazCryptoDecrypt(ctx, data, out, len(data))
return out.raw
print u"Using Library AlfCrypto DLL/DYLIB/SO"
print(u"Using Library AlfCrypto DLL/DYLIB/SO")
return (AES_CBC, Pukall_Cipher, Topaz_Cipher)
@@ -244,7 +245,7 @@ def _load_python_alfcrypto():
cleartext = self.aes.decrypt(iv + data)
return cleartext
print u"Using Library AlfCrypto Python"
print(u"Using Library AlfCrypto Python")
return (AES_CBC, Pukall_Cipher, Topaz_Cipher)