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

@ -23,7 +23,7 @@ import os.path
from stat import S_IWUSR
from traceback import format_exc
from platform import python_version
import md5
from hashlib import md5
from sys import stdin
from sys import platform
@ -242,7 +242,7 @@ def RemoveDist(Guid, Version, StoredDistFile, DataBase, WorkspaceDir, ForceRemov
#
# check whether modified by users
#
Md5Sigature = md5.new(open(str(Path), 'rb').read())
Md5Sigature = md5(open(str(Path), 'rb').read())
if Md5Sum != Md5Sigature.hexdigest():
Logger.Info(ST.MSG_CONFIRM_REMOVE2 % Path)
Input = stdin.readline()