diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-06-02 20:47:23 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-06-02 20:47:23 (GMT) |
commit | fddf12198fa43d411abb232c3ce8e97290717bfb (patch) | |
tree | 659e3a8bcbd61b8ed4548a252bea31489e2a391a /Lib/distutils/command | |
parent | 0d20189f63fcd6843a8ca5a7c5364ecb590bf01d (diff) | |
parent | 6a8e626a60baef76b03df81a0b087dc9fdc3efcf (diff) | |
download | cpython-fddf12198fa43d411abb232c3ce8e97290717bfb.zip cpython-fddf12198fa43d411abb232c3ce8e97290717bfb.tar.gz cpython-fddf12198fa43d411abb232c3ce8e97290717bfb.tar.bz2 |
Issue #21776: Merge from 3.5
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/upload.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py index 1c4fc48..0afcbf2 100644 --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@ -181,21 +181,21 @@ class upload(PyPIRCCommand): result = urlopen(request) status = result.getcode() reason = result.msg - except OSError as e: - self.announce(str(e), log.ERROR) - raise except HTTPError as e: status = e.code reason = e.msg + except OSError as e: + self.announce(str(e), log.ERROR) + raise if status == 200: self.announce('Server response (%s): %s' % (status, reason), log.INFO) + if self.show_response: + text = self._read_pypi_response(result) + msg = '\n'.join(('-' * 75, text, '-' * 75)) + self.announce(msg, log.INFO) else: msg = 'Upload failed (%s): %s' % (status, reason) self.announce(msg, log.ERROR) raise DistutilsError(msg) - if self.show_response: - text = self._read_pypi_response(result) - msg = '\n'.join(('-' * 75, text, '-' * 75)) - self.announce(msg, log.INFO) |