diff -r 9438a8aa3622 Lib/distutils/command/upload.py --- a/Lib/distutils/command/upload.py Wed Jun 11 06:18:43 2014 -0700 +++ b/Lib/distutils/command/upload.py Thu Jun 12 00:02:06 2014 +0100 @@ -10,7 +10,7 @@ import cStringIO as StringIO from hashlib import md5 -from distutils.errors import DistutilsOptionError +from distutils.errors import DistutilsError, DistutilsOptionError from distutils.core import PyPIRCCommand from distutils.spawn import spawn from distutils import log @@ -181,7 +181,7 @@ self.announce(msg, log.INFO) except socket.error, e: self.announce(str(e), log.ERROR) - return + raise except HTTPError, e: status = e.code reason = e.msg @@ -190,5 +190,6 @@ self.announce('Server response (%s): %s' % (status, reason), log.INFO) else: - self.announce('Upload failed (%s): %s' % (status, reason), - log.ERROR) + msg = 'Upload failed (%s): %s' % (status, reason) + self.announce(msg, log.ERROR) + raise DistutilsError(msg)