From 8da204f74aa8e0670b0dd890f474c44d59f5b250 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 13 Feb 2012 13:25:46 +0100 Subject: [PATCH] Always use cPickle, never 'regular' pickle. This fixes #18. --- rq/job.py | 2 +- rq/pickle.py | 9 --------- rq/worker.py | 2 +- tests/test_job.py | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 rq/pickle.py diff --git a/rq/job.py b/rq/job.py index 70f502f..c82a197 100644 --- a/rq/job.py +++ b/rq/job.py @@ -1,6 +1,6 @@ import times from uuid import uuid4 -from .pickle import loads, dumps, UnpicklingError +from cPickle import loads, dumps, UnpicklingError from .proxy import conn from .exceptions import UnpickleError, NoSuchJobError diff --git a/rq/pickle.py b/rq/pickle.py deleted file mode 100644 index 81e77b3..0000000 --- a/rq/pickle.py +++ /dev/null @@ -1,9 +0,0 @@ -from __future__ import absolute_import -try: - import cPickle as pickle -except ImportError: - import pickle # noqa - -loads = pickle.loads -dumps = pickle.dumps -UnpicklingError = pickle.UnpicklingError diff --git a/rq/worker.py b/rq/worker.py index 820346d..cb8c282 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -8,7 +8,7 @@ import procname import socket import signal import traceback -from .pickle import dumps +from cPickle import dumps try: from logbook import Logger Logger = Logger # Does nothing except it shuts up pyflakes annoying error diff --git a/tests/test_job.py b/tests/test_job.py index d913986..55e589e 100644 --- a/tests/test_job.py +++ b/tests/test_job.py @@ -2,7 +2,7 @@ import times from datetime import datetime from tests import RQTestCase from tests.helpers import strip_milliseconds -from rq.pickle import loads +from cPickle import loads from rq.job import Job from rq.exceptions import NoSuchJobError, UnpickleError