aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsetuptools/package_index.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 47f00c00..b1b38f03 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -222,7 +222,8 @@ class HashChecker(ContentChecker):
)
def __init__(self, hash_name, expected):
- self.hash = hashlib.new(hash_name)
+ self.hash_name = hash_name
+ self.hash = hashlib.new(hash_name)
self.expected = expected
@classmethod
@@ -242,23 +243,8 @@ class HashChecker(ContentChecker):
def is_valid(self):
return self.hash.hexdigest() == self.expected
- def _get_hash_name(self):
- """
- Python 2.4 implementation of MD5 doesn't supply a .name attribute
- so provide that name.
-
- When Python 2.4 is no longer required, replace invocations of this
- method with simply 'self.hash.name'.
- """
- try:
- return self.hash.name
- except AttributeError:
- if 'md5' in str(type(self.hash)):
- return 'md5'
- raise
-
def report(self, reporter, template):
- msg = template % self._get_hash_name()
+ msg = template % self.hash_name
return reporter(msg)