Meet @sigmavirus24's demanding stylistic criteria.
authorCory Benfield <lukasaoz@gmail.com>
Sun, 12 Jan 2014 09:39:32 +0000 (09:39 +0000)
committerCory Benfield <lukasaoz@gmail.com>
Sun, 12 Jan 2014 09:39:32 +0000 (09:39 +0000)
requests/utils.py

index 13b649d3bea606f905082c0d74bd72c2864dc600..528e7c90dd4d57893d0ecaa856d81f4cdf306510 100644 (file)
@@ -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'):