Use cPickle instead of pickle

This commit is contained in:
Gregory Soutade 2017-05-07 16:55:05 +02:00
parent 906fd5be11
commit 3ce35b7b47
1 changed files with 5 additions and 4 deletions

View File

@ -24,7 +24,7 @@ import shutil
import sys
import re
import time
import pickle
import cPickle
import gzip
import importlib
import argparse
@ -248,7 +248,7 @@ class IWLA(object):
os.makedirs(base)
with open(filename + '.tmp', 'wb+') as f, self._openDB(filename, 'w') as fzip:
pickle.dump(obj, f)
cPickle.dump(obj, f)
os.fsync(f)
f.seek(0)
fzip.write(f.read())
@ -258,9 +258,10 @@ class IWLA(object):
if not os.path.exists(filename):
return None
res = None
with self._openDB(filename) as f:
return pickle.load(f)
return None
res = cPickle.load(f)
return res
def _callPlugins(self, target_root, *args):
self.logger.info('==> Call plugins (%s)' % (target_root))