]> granicus.if.org Git - python/commitdiff
Fix for issue10367, courtesy of Daniel Tavares.
authorPhillip J. Eby <pje@telecommunity.com>
Fri, 3 Dec 2010 17:00:40 +0000 (17:00 +0000)
committerPhillip J. Eby <pje@telecommunity.com>
Fri, 3 Dec 2010 17:00:40 +0000 (17:00 +0000)
Lib/distutils/command/upload.py

index 980cf68d06dd4a2c1ceab5659743576725c81a23..d0133353a63a6c4aed923cf16db3a2fa2b96afac 100644 (file)
@@ -176,6 +176,9 @@ class upload(PyPIRCCommand):
             result = urlopen(request)
             status = result.getcode()
             reason = result.msg
+            if self.show_response:
+                msg = '\n'.join(('-' * 75, r.read(), '-' * 75))
+                self.announce(msg, log.INFO)
         except socket.error, e:
             self.announce(str(e), log.ERROR)
             return
@@ -189,6 +192,3 @@ class upload(PyPIRCCommand):
         else:
             self.announce('Upload failed (%s): %s' % (status, reason),
                           log.ERROR)
-        if self.show_response:
-            msg = '\n'.join(('-' * 75, r.read(), '-' * 75))
-            self.announce(msg, log.INFO)