Unwrap several for statements from 2to3 conversion process.

This commit is contained in:
Ryan Stein 2017-11-02 12:46:33 -04:00
parent 8c318c6d38
commit f2e800ddf1
22 changed files with 37 additions and 37 deletions

View file

@ -47,7 +47,7 @@ class TaskHandler(object):
tasks = value
# At this point, `tasks` contains a dictionary of still-serialized tasks
for task_id, value in list(tasks.items()):
for task_id, value in tasks.items():
date, callback, args, kwargs = dbunserialize(value)
if isinstance(callback, tuple):
# `callback` can be an object and name for instance methods
@ -64,7 +64,7 @@ class TaskHandler(object):
def save(self):
"""Save the tasks in ServerConfig."""
for task_id, (date, callback, args, kwargs) in list(self.tasks.items()):
for task_id, (date, callback, args, kwargs) in self.tasks.items():
if task_id in self.to_save:
continue
@ -127,7 +127,7 @@ class TaskHandler(object):
else:
safe_args.append(arg)
for key, value in list(kwargs.items()):
for key, value in kwargs.items():
try:
dbserialize(value)
except (TypeError, AttributeError):
@ -187,7 +187,7 @@ class TaskHandler(object):
"""
now = datetime.now()
for task_id, (date, callbac, args, kwargs) in list(self.tasks.items()):
for task_id, (date, callbac, args, kwargs) in self.tasks.items():
seconds = max(0, (date - now).total_seconds())
task.deferLater(reactor, seconds, self.do_task, task_id)

View file

@ -286,7 +286,7 @@ class TickerPool(object):
if interval and interval in self.tickers:
self.tickers[interval].stop()
else:
for ticker in list(self.tickers.values()):
for ticker in self.tickers.values():
ticker.stop()
@ -395,7 +395,7 @@ class TickerHandler(object):
store_key[2])} # a path given
# update the timers for the tickers
for store_key, (args, kwargs) in list(to_save.items()):
for store_key, (args, kwargs) in to_save.items():
interval = store_key[1]
# this is a mutable, so it's updated in-place in ticker_storage
kwargs["_start_delay"] = start_delays.get(interval, None)