Add specifics on the "ImportError" to the message in case of an attribute error.

This commit is contained in:
Vincent Driessen 2012-03-16 15:51:46 +01:00
parent be8f7684aa
commit 14ecb8e956
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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):