From ab066397b201cfaf32cfddd227b5447fe1da2579 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 23 Oct 2012 09:44:34 -0500 Subject: [PATCH] aes new raise compliant --- VERSION | 2 +- gluon/contrib/aes.py | 10 +++++----- gluon/rocket.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index 08e7b922..b53a93fb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.2.1 (2012-10-22 22:52:36) stable +Version 2.2.1 (2012-10-23 09:44:29) stable diff --git a/gluon/contrib/aes.py b/gluon/contrib/aes.py index 24e40878..cecf2d90 100644 --- a/gluon/contrib/aes.py +++ b/gluon/contrib/aes.py @@ -64,7 +64,7 @@ def new(key, mode=MODE_CBC, IV=None): return ECBMode(AES(key)) elif mode == MODE_CBC: if IV is None: - raise ValueError, "CBC mode needs an IV value!" + raise ValueError("CBC mode needs an IV value!") return CBCMode(AES(key), IV) else: @@ -91,7 +91,7 @@ class AES(object): elif self.key_size == 32: self.rounds = 14 else: - raise ValueError, "Key length must be 16, 24 or 32 bytes" + raise ValueError("Key length must be 16, 24 or 32 bytes") self.expand_key() @@ -313,7 +313,7 @@ class ECBMode(object): """Perform ECB mode with the given function""" if len(data) % self.block_size != 0: - raise ValueError, "Plaintext length must be multiple of 16" + raise ValueError("Plaintext length must be multiple of 16") block_size = self.block_size data = array('B', data) @@ -357,7 +357,7 @@ class CBCMode(object): block_size = self.block_size if len(data) % block_size != 0: - raise ValueError, "Plaintext length must be multiple of 16" + raise ValueError("Plaintext length must be multiple of 16") data = array('B', data) IV = self.IV @@ -381,7 +381,7 @@ class CBCMode(object): block_size = self.block_size if len(data) % block_size != 0: - raise ValueError, "Ciphertext length must be multiple of 16" + raise ValueError("Ciphertext length must be multiple of 16") data = array('B', data) IV = self.IV diff --git a/gluon/rocket.py b/gluon/rocket.py index af5e7133..c5dfff76 100644 --- a/gluon/rocket.py +++ b/gluon/rocket.py @@ -1670,8 +1670,8 @@ class WSGIWorker(Worker): peercert = conn.socket.getpeercert(binary_form=True) environ['SSL_CLIENT_RAW_CERT'] = \ peercert and ssl.DER_cert_to_PEM_cert(peercert) - except Exception, e: - print e + except Exception: + print sys.exc_info()[1] if environ.get('HTTP_TRANSFER_ENCODING', '') == 'chunked': environ['wsgi.input'] = ChunkedReader(sock_file)