mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
get_netrc_auth: code cleanup
* Stop iterating as soon as we find a netrc file * More obvious return None
This commit is contained in:
+3
-2
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user