summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2017-04-06 15:50:53 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2017-04-10 12:06:34 +0200
commit38e152a4272f79772b48f7232fc7f3a8ebbf61a6 (patch)
treed11f57bf19f85a5f61a2eda819a9f9f223e055d8 /numpy
parentae069153544cfc2d36aadcbfd15ae4b5444288b6 (diff)
downloadnumpy-38e152a4272f79772b48f7232fc7f3a8ebbf61a6.tar.gz
MAINT: remove hashlib fallback for python < 2.5
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/code_generators/genapi.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/numpy/core/code_generators/genapi.py b/numpy/core/code_generators/genapi.py
index c1e2d1fee..544597786 100644
--- a/numpy/core/code_generators/genapi.py
+++ b/numpy/core/code_generators/genapi.py
@@ -9,12 +9,7 @@ specified.
from __future__ import division, absolute_import, print_function
import sys, os, re
-try:
- import hashlib
- md5new = hashlib.md5
-except ImportError:
- import md5
- md5new = md5.new
+import hashlib
import textwrap
@@ -135,7 +130,7 @@ class Function(object):
return '\n'.join(lines)
def api_hash(self):
- m = md5new()
+ m = hashlib.md5()
m.update(remove_whitespace(self.return_type))
m.update('\000')
m.update(self.name)
@@ -479,7 +474,7 @@ def fullapi_hash(api_dicts):
a.extend(name)
a.extend(','.join(map(str, data)))
- return md5new(''.join(a).encode('ascii')).hexdigest()
+ return hashlib.md5(''.join(a).encode('ascii')).hexdigest()
# To parse strings like 'hex = checksum' where hex is e.g. 0x1234567F and
# checksum a 128 bits md5 checksum (hex format as well)
@@ -504,7 +499,7 @@ def main():
tagname = sys.argv[1]
order_file = sys.argv[2]
functions = get_api_functions(tagname, order_file)
- m = md5new(tagname)
+ m = hashlib.md5(tagname)
for func in functions:
print(func)
ah = func.api_hash()