From: Yunhua Feng Date: Tue, 31 Jul 2018 08:32:57 +0000 (+0800) Subject: BaseTools: Use pickle to replace cPickle X-Git-Tag: edk2-stable201903~1303 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=3a0c1bf64b5deaa4e227b311cc43aa1513beae5e BaseTools: Use pickle to replace cPickle Use pickle to replace cPickle because of python3 removed cPickle Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index fd948c727a..74a5f0bca5 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -21,7 +21,7 @@ import string import threading import time import re -import cPickle +import pickle import array import shutil from struct import pack @@ -499,7 +499,7 @@ def DataDump(Data, File): Fd = None try: Fd = open(File, 'wb') - cPickle.dump(Data, Fd, cPickle.HIGHEST_PROTOCOL) + pickle.dump(Data, Fd, pickle.HIGHEST_PROTOCOL) except: EdkLogger.error("", FILE_OPEN_FAILURE, ExtraData=File, RaiseError=False) finally: @@ -518,7 +518,7 @@ def DataRestore(File): Fd = None try: Fd = open(File, 'rb') - Data = cPickle.load(Fd) + Data = pickle.load(Fd) except Exception as e: EdkLogger.verbose("Failed to load [%s]\n\t%s" % (File, str(e))) Data = None