Use pickle to replace cPickle because of python3 removed cPickle
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>
import threading\r
import time\r
import re\r
-import cPickle\r
+import pickle\r
import array\r
import shutil\r
from struct import pack\r
Fd = None\r
try:\r
Fd = open(File, 'wb')\r
- cPickle.dump(Data, Fd, cPickle.HIGHEST_PROTOCOL)\r
+ pickle.dump(Data, Fd, pickle.HIGHEST_PROTOCOL)\r
except:\r
EdkLogger.error("", FILE_OPEN_FAILURE, ExtraData=File, RaiseError=False)\r
finally:\r
Fd = None\r
try:\r
Fd = open(File, 'rb')\r
- Data = cPickle.load(Fd)\r
+ Data = pickle.load(Fd)\r
except Exception as e:\r
EdkLogger.verbose("Failed to load [%s]\n\t%s" % (File, str(e)))\r
Data = None\r