Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
937a7dee
Commit
937a7dee
authored
Jul 22, 2013
by
Daniel Holth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
package_index.py : fix hash_name
parent
70067439
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
17 deletions
+3
-17
setuptools/package_index.py
setuptools/package_index.py
+3
-17
No files found.
setuptools/package_index.py
View file @
937a7dee
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment