Skip to content

Commit 5806d82

Browse files
committed
Allow auth to be None with neither username nor password are set.
1 parent ee3c27b commit 5806d82

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

twine/repository.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ def __init__(
6262
self.session = requests.session()
6363
# requests.Session.auth should be Tuple[str, str], ...], but
6464
# username/password could be None (see TODO for utils.RepositoryConfig)
65-
self.session.auth = (username or '', password or '')
65+
self.session.auth = (
66+
(username or '', password or '')
67+
if username or password
68+
else None
69+
)
6670
self.session.headers['User-Agent'] = self._make_user_agent_string()
6771
for scheme in ('http://', 'https://'):
6872
self.session.mount(scheme, self._make_adapter_with_retries())

0 commit comments

Comments
 (0)