md5sum: assume hashlib exists now that we're 2.7 only
authorAugie Fackler <raf@durin42.com>
Tue, 22 Aug 2017 14:57:10 -0400
changeset 33873 904bc1dc2694
parent 33872 5d9890d8ca77
child 33874 3b1add641232
md5sum: assume hashlib exists now that we're 2.7 only
tests/md5sum.py
--- 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)