From 18cdade7058bd8ca4b86c5dc6dc6ab35e9fada69 Mon Sep 17 00:00:00 2001 From: Michele Comitini Date: Tue, 24 Sep 2013 18:37:10 +0200 Subject: [PATCH] added support for python2.5 --- gluon/contrib/pbkdf2_ctypes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gluon/contrib/pbkdf2_ctypes.py b/gluon/contrib/pbkdf2_ctypes.py index 8cad65dc..91ce1541 100644 --- a/gluon/contrib/pbkdf2_ctypes.py +++ b/gluon/contrib/pbkdf2_ctypes.py @@ -25,6 +25,7 @@ import hashlib import platform import os.path import binascii +import sys __all__ = ['pkcs5_pbkdf2_hmac', 'pbkdf2_bin', 'pbkdf2_hex'] __version__ = '0.99.3' @@ -151,7 +152,8 @@ try: # check that we have proper OpenSSL or Common Crypto on the system. _pbkdf2_hmac = _openssl_pbkdf2 crypto.PKCS5_PBKDF2_HMAC # test compatibility -except (OSError, AttributeError) as e: +except (OSError, AttributeError): + _, e, _ = sys.exc_info() raise ImportError('Cannot find a compatible cryptographic library ' 'on your system. %s' % e)