summaryrefslogtreecommitdiff
path: root/setuptools/command/upload.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-02-02 09:00:35 -0500
committerJason R. Coombs <jaraco@jaraco.com>2017-02-02 09:01:40 -0500
commited360af83a547d565aea8c20d3086486c4c9491c (patch)
treeef55d6cab7ca3bbf1ab2585f31668ac9111ffda7 /setuptools/command/upload.py
parent90e95f2367a2325dbf29e5a7a92ef483806ae7b9 (diff)
downloadpython-setuptools-git-ed360af83a547d565aea8c20d3086486c4c9491c.tar.gz
Infer the username using getpass.getuser() if no username is resolved from .pypirc.
Diffstat (limited to 'setuptools/command/upload.py')
-rw-r--r--setuptools/command/upload.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py
index 484baa5a..a44173a9 100644
--- a/setuptools/command/upload.py
+++ b/setuptools/command/upload.py
@@ -10,6 +10,10 @@ class upload(orig.upload):
def finalize_options(self):
orig.upload.finalize_options(self)
+ self.username = (
+ self.username or
+ getpass.getuser()
+ )
# Attempt to obtain password. Short circuit evaluation at the first
# sign of success.
self.password = (