diff options
author | Feng, YunhuaX <yunhuax.feng@intel.com> | 2018-08-08 14:56:55 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-08-23 15:01:27 +0800 |
commit | fcb1af1b69f8c491824aaa589c7693fa6e731e0b (patch) | |
tree | 56bb15c40ef0c9013e25939704b9b192972a26e8 /BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py | |
parent | 87010d3d02547c81f1add57a4e2ef0483c65fddf (diff) | |
download | edk2-fcb1af1b69f8c491824aaa589c7693fa6e731e0b.tar.gz edk2-fcb1af1b69f8c491824aaa589c7693fa6e731e0b.tar.bz2 edk2-fcb1af1b69f8c491824aaa589c7693fa6e731e0b.zip |
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>
Diffstat (limited to 'BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py')
-rw-r--r-- | BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py index 0ba07ccebc..e2dd6a02dc 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py @@ -19,7 +19,7 @@ GenDEC import os
import stat
import codecs
-import md5
+from hashlib import md5
from Core.FileHook import __FileHookOpen__
from Library.Parsing import GenSection
from Library.CommentGenerating import GenHeaderCommentSection
@@ -646,7 +646,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO File = codecs.open(ContainerFile, 'w', Encoding)
File.write(u'\uFEFF' + Content)
File.stream.close()
- Md5Sigature = md5.new(__FileHookOpen__(str(ContainerFile), 'rb').read())
+ Md5Sigature = md5(__FileHookOpen__(str(ContainerFile), 'rb').read())
Md5Sum = Md5Sigature.hexdigest()
if (ContainerFile, Md5Sum) not in PackageObject.FileList:
PackageObject.FileList.append((ContainerFile, Md5Sum))
|