From 3ce35b7b47482c4796af92f22ee540045eb9bf21 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Sun, 7 May 2017 16:55:05 +0200 Subject: [PATCH] Use cPickle instead of pickle --- iwla.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/iwla.py b/iwla.py index b14e64b..aba885f 100755 --- a/iwla.py +++ b/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))