From 14ecb8e95678e60d0a198a86b4d9ae719e6f7c15 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 16 Mar 2012 15:51:46 +0100 Subject: [PATCH] Add specifics on the "ImportError" to the message in case of an attribute error. --- rq/job.py | 3 +++ tests/test_worker.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rq/job.py b/rq/job.py index 50ab65e..dc41bad 100644 --- a/rq/job.py +++ b/rq/job.py @@ -15,6 +15,9 @@ def unpickle(pickled_string): """ try: obj = loads(pickled_string) + except AttributeError as e: + raise UnpickleError('Could not unpickle: %s' % e.message, + pickled_string) except (StandardError, UnpicklingError): raise UnpickleError('Could not unpickle.', pickled_string) return obj diff --git a/tests/test_worker.py b/tests/test_worker.py index 2ab8019..13f3e8f 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -52,7 +52,6 @@ class TestWorker(RQTestCase): w = Worker([q]) w.work(burst=True) # should silently pass self.assertEquals(q.count, 0) - self.assertEquals(failed_q.count, 1) def test_work_fails(self):