diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-31 15:26:43 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-31 15:26:43 -0700 |
commit | 69ab59e59670c3865fb8240aa81ca9195a96e003 (patch) | |
tree | 7b611cfa2756eaf9e8dd3074f32e6154255817c4 | |
parent | 314367541aeff53ac93d19096cd9a0fa7c21ae09 (diff) | |
download | cryptography-69ab59e59670c3865fb8240aa81ca9195a96e003.tar.gz cryptography-69ab59e59670c3865fb8240aa81ca9195a96e003.tar.bz2 cryptography-69ab59e59670c3865fb8240aa81ca9195a96e003.zip |
py3k uses a different exception here
-rw-r--r-- | cryptography/fernet.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cryptography/fernet.py b/cryptography/fernet.py index ef64b7e9..f923911a 100644 --- a/cryptography/fernet.py +++ b/cryptography/fernet.py @@ -1,4 +1,5 @@ import base64 +import binascii import os import struct import time @@ -60,7 +61,7 @@ class Fernet(object): try: data = base64.urlsafe_b64decode(data) - except TypeError: + except (TypeError, binascii.Error): raise InvalidToken assert six.indexbytes(data, 0) == 0x80 |