Permalink
Browse files

catch decode exception

  • Loading branch information...
1 parent f053bc4 commit 3ce77585ee1674b874a2ff57b0af206a511bda81 @fogleman committed Aug 26, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 util.py
View
7 util.py
@@ -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)

0 comments on commit 3ce7758

Please sign in to comment.