summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2017-04-25 21:04:10 -0700
committerTim Graham <timograham@gmail.com>2017-04-26 10:54:20 -0400
commit92bc7272711536bb36c2190fcd3476de04e713ee (patch)
tree2bdf530382438a57053dcda473727b3af150dfd3 /django/core
parent309c10c2cbfdedd0967940b429567b35e95fb070 (diff)
Replaced temporary lists used for passing arguments with iterables.
Diffstat (limited to 'django/core')
-rw-r--r--django/core/checks/registry.py5
-rw-r--r--django/core/management/commands/makemigrations.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/django/core/checks/registry.py b/django/core/checks/registry.py
index 581783ad0b..4f7a9618c8 100644
--- a/django/core/checks/registry.py
+++ b/django/core/checks/registry.py
@@ -86,7 +86,10 @@ class CheckRegistry:
return tag in self.tags_available(include_deployment_checks)
def tags_available(self, deployment_checks=False):
- return set(chain(*[check.tags for check in self.get_checks(deployment_checks) if hasattr(check, 'tags')]))
+ return set(chain.from_iterable(
+ check.tags for check in self.get_checks(deployment_checks)
+ if hasattr(check, 'tags')
+ ))
def get_checks(self, include_deployment_checks=False):
checks = list(self.registered_checks)
diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py
index a648062565..013b6035b7 100644
--- a/django/core/management/commands/makemigrations.py
+++ b/django/core/management/commands/makemigrations.py
@@ -244,7 +244,7 @@ class Command(BaseCommand):
def all_items_equal(seq):
return all(item == seq[0] for item in seq[1:])
- merge_migrations_generations = zip(*[m.ancestry for m in merge_migrations])
+ merge_migrations_generations = zip(*(m.ancestry for m in merge_migrations))
common_ancestor_count = sum(1 for common_ancestor_generation
in takewhile(all_items_equal, merge_migrations_generations))
if not common_ancestor_count: