Mercurial > hg
changeset 33873:904bc1dc2694
md5sum: assume hashlib exists now that we're 2.7 only
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Tue, 22 Aug 2017 14:57:10 -0400 |
parents | 5d9890d8ca77 |
children | 3b1add641232 |
files | tests/md5sum.py |
diffstat | 1 files changed, 2 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/md5sum.py Tue Aug 22 12:58:51 2017 -0400 +++ b/tests/md5sum.py Tue Aug 22 14:57:10 2017 -0400 @@ -8,17 +8,11 @@ from __future__ import absolute_import +import hashlib import os import sys try: - import hashlib - md5 = hashlib.md5 -except ImportError: - import md5 - md5 = md5.md5 - -try: import msvcrt msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) @@ -32,7 +26,7 @@ sys.stderr.write('%s: Can\'t open: %s\n' % (filename, msg)) sys.exit(1) - m = md5() + m = hashlib.md5() try: for data in iter(lambda: fp.read(8192), b''): m.update(data)