@@ -169,17 +169,17 @@ def _call_task_errbacks(self, request, exc, traceback):
169
169
for errback in request .errbacks :
170
170
errback = self .app .signature (errback )
171
171
if (
172
- # Celery tasks type created with the @task decorator have the
173
- # __header__ property, but Celery task created from Task
174
- # class do not have this property.
175
- # That's why we have to check if this property exists before
176
- # checking is it partial function.
177
- hasattr (errback .type , '__header__' ) and
178
-
179
- # workaround to support tasks with bind=True executed as
180
- # link errors. Otherwise retries can't be used
181
- not isinstance (errback .type .__header__ , partial ) and
182
- arity_greater (errback .type .__header__ , 1 )
172
+ # Celery tasks type created with the @task decorator have
173
+ # the __header__ property, but Celery task created from
174
+ # Task class do not have this property.
175
+ # That's why we have to check if this property exists
176
+ # before checking is it partial function.
177
+ hasattr (errback .type , '__header__' ) and
178
+
179
+ # workaround to support tasks with bind=True executed as
180
+ # link errors. Otherwise retries can't be used
181
+ not isinstance (errback .type .__header__ , partial ) and
182
+ arity_greater (errback .type .__header__ , 1 )
183
183
):
184
184
errback (request , exc , traceback )
185
185
else :
@@ -235,9 +235,9 @@ def fail_from_current_stack(self, task_id, exc=None):
235
235
type_ , real_exc , tb = sys .exc_info ()
236
236
try :
237
237
exc = real_exc if exc is None else exc
238
- ei = ExceptionInfo ((type_ , exc , tb ))
239
- self .mark_as_failure (task_id , exc , ei .traceback )
240
- return ei
238
+ exception_info = ExceptionInfo ((type_ , exc , tb ))
239
+ self .mark_as_failure (task_id , exc , exception_info .traceback )
240
+ return exception_info
241
241
finally :
242
242
del tb
243
243
@@ -312,8 +312,8 @@ def prepare_expires(self, value, type=None):
312
312
def prepare_persistent (self , enabled = None ):
313
313
if enabled is not None :
314
314
return enabled
315
- p = self .app .conf .result_persistent
316
- return self .persistent if p is None else p
315
+ persistent = self .app .conf .result_persistent
316
+ return self .persistent if persistent is None else persistent
317
317
318
318
def encode_result (self , result , state ):
319
319
if state in self .EXCEPTION_STATES and isinstance (result , Exception ):
@@ -602,11 +602,11 @@ def _strip_prefix(self, key):
602
602
return bytes_to_str (key )
603
603
604
604
def _filter_ready (self , values , READY_STATES = states .READY_STATES ):
605
- for k , v in values :
606
- if v is not None :
607
- v = self .decode_result (v )
608
- if v ['status' ] in READY_STATES :
609
- yield k , v
605
+ for k , value in values :
606
+ if value is not None :
607
+ value = self .decode_result (value )
608
+ if value ['status' ] in READY_STATES :
609
+ yield k , value
610
610
611
611
def _mget_to_results (self , values , keys ):
612
612
if hasattr (values , 'items' ):
0 commit comments