Skip to content

Commit

Permalink
catch decode exception
Browse files Browse the repository at this point in the history
  • Loading branch information
fogleman committed Aug 26, 2011
1 parent f053bc4 commit 3ce7758
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ def encode_password(password):
return base64.b64encode(password) if password else None

def decode_password(password):
return base64.b64decode(password) if password else None

try:
return base64.b64decode(password) if password else None
except Exception:
return None

def get_proxy():
if settings.USE_PROXY:
url = decode_password(settings.PROXY_URL)
Expand Down

0 comments on commit 3ce7758

Please sign in to comment.