From: Chris Adams Date: Tue, 7 Jan 2014 17:23:11 +0000 (-0500) Subject: get_netrc_auth: code cleanup X-Git-Tag: v2.2.0~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a80bd7708d620ba1797aed1ca0840996fa137517;p=services%2Fpython-requests.git get_netrc_auth: code cleanup * Stop iterating as soon as we find a netrc file * More obvious return None --- diff --git a/requests/utils.py b/requests/utils.py index 580e5fc..04e5a2b 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -82,12 +82,13 @@ def get_netrc_auth(url): # https://github.com/kennethreitz/requests/issues/1846 return - if os.path.exists(loc) and not netrc_path: + if os.path.exists(loc): netrc_path = loc + break # Abort early if there isn't one. if netrc_path is None: - return netrc_path + return ri = urlparse(url)