diff options
Diffstat (limited to 'Lib/distutils/command/register.py')
-rw-r--r-- | Lib/distutils/command/register.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Lib/distutils/command/register.py b/Lib/distutils/command/register.py index 30e9a37e6a..c271b18c4c 100644 --- a/Lib/distutils/command/register.py +++ b/Lib/distutils/command/register.py @@ -174,19 +174,23 @@ Your selection [default 1]: ''', log.INFO) log.INFO) # possibly save the login - if not self.has_config and code == 200: - self.announce(('I can store your PyPI login so future ' - 'submissions will be faster.'), log.INFO) - self.announce('(the login will be stored in %s)' % \ - self._get_rc_file(), log.INFO) - - choice = 'X' - while choice.lower() not in 'yn': - choice = input('Save your login (y/N)?') - if not choice: - choice = 'n' - if choice.lower() == 'y': - self._store_pypirc(username, password) + if code == 200: + if self.has_config: + # sharing the password in the distribution instance + # so the upload command can reuse it + self.distribution.password = password + else: + self.announce(('I can store your PyPI login so future ' + 'submissions will be faster.'), log.INFO) + self.announce('(the login will be stored in %s)' % \ + self._get_rc_file(), log.INFO) + choice = 'X' + while choice.lower() not in 'yn': + choice = input('Save your login (y/N)?') + if not choice: + choice = 'n' + if choice.lower() == 'y': + self._store_pypirc(username, password) elif choice == '2': data = {':action': 'user'} |