aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
authorDaniel Holth <dholth@fastmail.fm>2013-07-22 17:32:14 +0000
committerDaniel Holth <dholth@fastmail.fm>2013-07-22 17:32:14 +0000
commit937a7dee0b5de773f164d7e3b143113c270733eb (patch)
tree9d69ad92813561d758f236916cb5fe5ac62f016b /setuptools/package_index.py
parent70067439d3b2b53cf2112ed0faf52c30b30ef3cd (diff)
downloadexternal_python_setuptools-937a7dee0b5de773f164d7e3b143113c270733eb.tar.gz
external_python_setuptools-937a7dee0b5de773f164d7e3b143113c270733eb.tar.bz2
external_python_setuptools-937a7dee0b5de773f164d7e3b143113c270733eb.zip
package_index.py : fix hash_name
Diffstat (limited to 'setuptools/package_index.py')
-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)