Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Unified Diff: Lib/distutils/command/upload.py

Issue 21722: teach distutils "upload" to exit with code != 0 when error occurs
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/distutils/tests/test_upload.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/distutils/command/upload.py Wed Jun 11 06:18:43 2014 -0700
+++ b/Lib/distutils/command/upload.py Thu Jun 12 01:26:38 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)
« no previous file with comments | « no previous file | Lib/distutils/tests/test_upload.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+