BaseTools: Use hashlib instead of md5

Use from hashlib import md5 instead of import md5
due to md5 deprecated in python3

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Feng, YunhuaX
2018-08-08 14:56:55 +08:00
committed by Yonghong Zhu
parent 87010d3d02
commit fcb1af1b69
6 changed files with 17 additions and 17 deletions

View File

@ -27,7 +27,7 @@ from sys import stdin
from sys import platform
from traceback import format_exc
from platform import python_version
import md5
from hashlib import md5
from time import strftime
from time import localtime
from uuid import uuid4
@ -196,7 +196,7 @@ def Main(Options = None):
#
# Add Md5Sigature
#
DistPkg.Header.Signature = md5.new(open(str(ContentFile), 'rb').read()).hexdigest()
DistPkg.Header.Signature = md5(open(str(ContentFile), 'rb').read()).hexdigest()
#
# Add current Date
#