Skip to content

Commit

Permalink
Allow auth to be None with neither username nor password are set.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 10, 2019
1 parent e4ddbbc commit 08e3fc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion twine/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def __init__(
self.session = requests.session()
# requests.Session.auth should be Tuple[str, str], ...], but
# username/password could be None (see TODO for utils.RepositoryConfig)
self.session.auth = (username or '', password or '')
self.session.auth = (
(username or '', password or '')
if username or password
else None
)
self.session.headers['User-Agent'] = self._make_user_agent_string()
for scheme in ('http://', 'https://'):
self.session.mount(scheme, self._make_adapter_with_retries())
Expand Down

0 comments on commit 08e3fc6

Please sign in to comment.