Skip to content
Myr

get_netrc_auth: code cleanup

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Stop iterating as soon as we find a netrc file * More obvious return None

authored by Chris Adams · committed by Chris Adams · parent 0b41cec · Browse files · 1 file+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:requests/utils.py+3 added-2 removed
80 unmodified lines
81 # getpwuid fails. See http://bugs.python.org/issue20164 &82 # https://github.com/kennethreitz/requests/issues/184683 return8485 if os.path.exists(loc) and not netrc_path:85 if os.path.exists(loc):86 netrc_path = loc87 break8889 # Abort early if there isn't one.90 if netrc_path is None:90 return netrc_path91 return9293 ri = urlparse(url)9495 # Strip port numbers from netloc
557 unmodified lines