projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de0658f
)
netrc fix
author
Kenneth Reitz
<me@kennethreitz.com>
Mon, 20 Feb 2012 20:43:45 +0000
(15:43 -0500)
committer
Kenneth Reitz
<me@kennethreitz.com>
Mon, 20 Feb 2012 20:43:45 +0000
(15:43 -0500)
requests/utils.py
patch
|
blob
|
history
diff --git
a/requests/utils.py
b/requests/utils.py
index
c9f5ad7
..
dd93b05
100644
(file)
--- a/
requests/utils.py
+++ b/
requests/utils.py
@@
-46,8
+46,10
@@
def get_netrc_auth(url):
try:
_netrc = netrc(netrc_path).authenticators(host)
- # Return with login / password
- return (_netrc[0 if _netrc[0] else 1], _netrc[2])
+ if _netrc:
+ # Return with login / password
+ login_i = (0 if _netrc[0] else 1)
+ return (_netrc[login_i], _netrc[2])
except NetrcParseError:
pass