From 67880343f1e3e8a0127db445ea07afba4e1a97b9 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 31 Jan 2013 16:28:16 +0100 Subject: [PATCH] Make inner_exception optional, and use new except syntax. --- rq/exceptions.py | 2 +- rq/job.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rq/exceptions.py b/rq/exceptions.py index 4fb983d..59c1429 100644 --- a/rq/exceptions.py +++ b/rq/exceptions.py @@ -11,6 +11,6 @@ class NoQueueError(Exception): class UnpickleError(Exception): - def __init__(self, message, raw_data, inner_exception): + def __init__(self, message, raw_data, inner_exception=None): super(UnpickleError, self).__init__(message, inner_exception) self.raw_data = raw_data diff --git a/rq/job.py b/rq/job.py index aebf9eb..2000806 100644 --- a/rq/job.py +++ b/rq/job.py @@ -27,7 +27,7 @@ def unpickle(pickled_string): """ try: obj = loads(pickled_string) - except (StandardError, UnpicklingError), e: + except (StandardError, UnpicklingError) as e: raise UnpickleError('Could not unpickle.', pickled_string, e) return obj