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

main
Vincent Driessen 13 years ago
parent be8f7684aa
commit 14ecb8e956

@ -15,6 +15,9 @@ def unpickle(pickled_string):
""" """
try: try:
obj = loads(pickled_string) obj = loads(pickled_string)
except AttributeError as e:
raise UnpickleError('Could not unpickle: %s' % e.message,
pickled_string)
except (StandardError, UnpicklingError): except (StandardError, UnpicklingError):
raise UnpickleError('Could not unpickle.', pickled_string) raise UnpickleError('Could not unpickle.', pickled_string)
return obj return obj

@ -52,7 +52,6 @@ class TestWorker(RQTestCase):
w = Worker([q]) w = Worker([q])
w.work(burst=True) # should silently pass w.work(burst=True) # should silently pass
self.assertEquals(q.count, 0) self.assertEquals(q.count, 0)
self.assertEquals(failed_q.count, 1) self.assertEquals(failed_q.count, 1)
def test_work_fails(self): def test_work_fails(self):

Loading…
Cancel
Save