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 | 61169c4c67995175e44bd73d21cb467a67e6e262 (patch) | |
tree | 15f1135cd34e38207634bea26f43114263d20826 | |
parent | 304f80e0b68284c072579d8ce6aaf9ed2cd47996 (diff) | |
download | python-setuptools-bitbucket-61169c4c67995175e44bd73d21cb467a67e6e262.tar.gz |
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): |