From 4a7c7279f57e3ec052e3f115d4b71ec0acfca78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Wed, 3 Apr 2013 22:57:59 +0200 Subject: [PATCH] use pickle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/metadata.py | 4 ++-- src/ponysay-tool.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/metadata.py b/src/metadata.py index 500c345a..74c92709 100755 --- a/src/metadata.py +++ b/src/metadata.py @@ -107,12 +107,12 @@ class Metadata(): ''' @staticmethod def restrictedPonies(ponydir, logic): - import cPickle + import pickle passed = [] if os.path.exists(ponydir + 'metadata'): data = None with open(ponydir + 'metadata', 'rb') as file: - data = cPickle.load(file) + data = pickle.load(file) for ponydata in data: (pony, meta) = ponydata if logic(meta): diff --git a/src/ponysay-tool.py b/src/ponysay-tool.py index e207ed3f..49380416 100755 --- a/src/ponysay-tool.py +++ b/src/ponysay-tool.py @@ -646,9 +646,9 @@ class PonysayTool(): if (len(test) == 0) and (len(key) > 0): data.append((key, makeset(value.replace(' ', '')))) everything.append((ponyfile[:-5], data)) - import cPickle + import pickle with open((ponydir + '/metadata').replace('//', '/'), 'wb') as file: - cPickle.dump(everything, file, -1) + pickle.dump(everything, file, -1) file.flush()