Use cPickle instead of pickle
This commit is contained in:
parent
906fd5be11
commit
3ce35b7b47
9
iwla.py
9
iwla.py
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user