diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-11-17 17:00:39 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-11-17 17:00:39 -0500 |
commit | 2ac91b232f9f7061c53b51520353c31b12d576be (patch) | |
tree | 28af4f95f7cee7561d0d23e00bc522ca70759e2a | |
parent | 34668623d92b950634a2fcf750d902fb34f321ae (diff) | |
download | external_python_setuptools-2ac91b232f9f7061c53b51520353c31b12d576be.tar.gz external_python_setuptools-2ac91b232f9f7061c53b51520353c31b12d576be.tar.bz2 external_python_setuptools-2ac91b232f9f7061c53b51520353c31b12d576be.zip |
Extract parameter to exceptions and remove superfluous parentheses
-rw-r--r-- | scripts/upload-old-releases-as-zip.py | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/scripts/upload-old-releases-as-zip.py b/scripts/upload-old-releases-as-zip.py index e08e4bb4..f0ca41c3 100644 --- a/scripts/upload-old-releases-as-zip.py +++ b/scripts/upload-old-releases-as-zip.py @@ -167,18 +167,16 @@ class SetuptoolsOldReleasesWithoutZip(object): print 'Total releases without zip: %s' % len(releases_without_zip) print 'Total downloaded: %s' % self.total_downloaded_ok if failed_md5_releases: - raise(Exception( - FAIL + ( - "FAIL: these releases %s failed the md5 check!" % - ','.join(failed_md5_releases) - ) + END - )) + msg = FAIL + ( + "FAIL: these releases %s failed the md5 check!" % + ','.join(failed_md5_releases) + ) + END + raise Exception(msg) elif self.total_downloaded_ok != len(releases_without_zip): - raise(Exception( - FAIL + ( - "FAIL: Unknown error occured. Please check the logs." - ) + END - )) + msg = FAIL + ( + "FAIL: Unknown error occured. Please check the logs." + ) + END + raise Exception(msg) else: print OK + "All releases downloaded and md5 checked." + END @@ -212,12 +210,11 @@ class SetuptoolsOldReleasesWithoutZip(object): total_converted += 1 print 'Total converted: %s' % total_converted if self.total_downloaded_ok != total_converted: - raise(Exception( - FAIL + ( - "FAIL: Total number of downloaded releases is different" - " from converted ones. Please check the logs." - ) + END - )) + msg = FAIL + ( + "FAIL: Total number of downloaded releases is different" + " from converted ones. Please check the logs." + ) + END + raise Exception(msg) print "Done with the tar.gz->zip. Check folder %s." % main.dirpath def upload_zips_to_pypi(self): |