From b4ca6c95b60230ad604f8b89440fef18cfaa3a8c Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Sun, 12 Jan 2014 09:39:32 +0000 Subject: [PATCH] Meet @sigmavirus24's demanding stylistic criteria. --- requests/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index 13b649d3..528e7c90 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -638,11 +638,13 @@ def get_auth_from_url(url): parsed = urlparse(url) try: - return (unquote(parsed.username), unquote(parsed.password)) + auth = (unquote(parsed.username), unquote(parsed.password)) except (AttributeError, TypeError): - pass + auth = ('', '') + else: + auth = ('', '') - return ('', '') + return auth def to_native_string(string, encoding='ascii'):