Skip to content

Commit

Permalink
Add specifics on the "ImportError" to the message in case of an attri…
Browse files Browse the repository at this point in the history
…bute error.
  • Loading branch information
nvie committed Mar 16, 2012
1 parent be8f768 commit 14ecb8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions rq/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def test_work_is_unreadable(self):
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):
Expand Down

0 comments on commit 14ecb8e

Please sign in to comment.