projects
/
platform
/
upstream
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b41cec
)
get_netrc_auth: code cleanup
author
Chris Adams
<chris@improbable.org>
Tue, 7 Jan 2014 17:23:11 +0000
(12:23 -0500)
committer
Chris Adams
<chris@improbable.org>
Tue, 7 Jan 2014 17:23:11 +0000
(12:23 -0500)
* Stop iterating as soon as we find a netrc file
* More obvious return None
requests/utils.py
patch
|
blob
|
history
diff --git
a/requests/utils.py
b/requests/utils.py
index
580e5fc
..
04e5a2b
100644
(file)
--- 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)