summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2017-06-01 16:08:59 -0700
committerTim Graham <timograham@gmail.com>2017-06-01 19:08:59 -0400
commit2c69824e5ab5ddf4b9964c4cf9f9e16ff3bb7929 (patch)
tree65b8e60b858e4f073a04c2bbf976b8f43fe0cff6 /django/core
parentedee5a8de6afb34a9247de2bb73ab66397a6e573 (diff)
Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.
Diffstat (limited to 'django/core')
-rw-r--r--django/core/cache/backends/memcached.py2
-rw-r--r--django/core/management/base.py2
-rw-r--r--django/core/management/commands/loaddata.py2
-rw-r--r--django/core/management/commands/makemigrations.py2
-rw-r--r--django/core/management/commands/migrate.py2
5 files changed, 5 insertions, 5 deletions
diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py
index 6e8211bdff..acc0613e6b 100644
--- a/django/core/cache/backends/memcached.py
+++ b/django/core/cache/backends/memcached.py
@@ -159,7 +159,7 @@ class MemcachedCache(BaseMemcachedCache):
@property
def _cache(self):
if getattr(self, '_client', None) is None:
- client_kwargs = dict(pickleProtocol=pickle.HIGHEST_PROTOCOL)
+ client_kwargs = {'pickleProtocol': pickle.HIGHEST_PROTOCOL}
client_kwargs.update(self._options)
self._client = self._lib.Client(self._servers, **client_kwargs)
return self._client
diff --git a/django/core/management/base.py b/django/core/management/base.py
index 857c15fb60..61ce6ebec5 100644
--- a/django/core/management/base.py
+++ b/django/core/management/base.py
@@ -428,7 +428,7 @@ class BaseCommand:
plan = executor.migration_plan(executor.loader.graph.leaf_nodes())
if plan:
- apps_waiting_migration = sorted(set(migration.app_label for migration, backwards in plan))
+ apps_waiting_migration = sorted({migration.app_label for migration, backwards in plan})
self.stdout.write(
self.style.NOTICE(
"\nYou have %(unpplied_migration_count)s unapplied migration(s). "
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
index 49679599a2..786957e86f 100644
--- a/django/core/management/commands/loaddata.py
+++ b/django/core/management/commands/loaddata.py
@@ -235,7 +235,7 @@ class Command(BaseCommand):
'.'.join(ext for ext in combo if ext)
for combo in product(databases, ser_fmts, cmp_fmts)
)
- targets = set('.'.join((fixture_name, suffix)) for suffix in suffixes)
+ targets = {'.'.join((fixture_name, suffix)) for suffix in suffixes}
fixture_files = []
for fixture_dir in fixture_dirs:
diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py
index 013b6035b7..45fce19b0f 100644
--- a/django/core/management/commands/makemigrations.py
+++ b/django/core/management/commands/makemigrations.py
@@ -78,7 +78,7 @@ class Command(BaseCommand):
loader = MigrationLoader(None, ignore_no_migrations=True)
# Raise an error if any migrations are applied before their dependencies.
- consistency_check_labels = set(config.label for config in apps.get_app_configs())
+ consistency_check_labels = {config.label for config in apps.get_app_configs()}
# Non-default databases are only checked if database routers used.
aliases_to_check = connections if settings.DATABASE_ROUTERS else [DEFAULT_DB_ALIAS]
for alias in sorted(aliases_to_check):
diff --git a/django/core/management/commands/migrate.py b/django/core/management/commands/migrate.py
index eb50026eab..e549b7200b 100644
--- a/django/core/management/commands/migrate.py
+++ b/django/core/management/commands/migrate.py
@@ -143,7 +143,7 @@ class Command(BaseCommand):
if target_app_labels_only:
self.stdout.write(
self.style.MIGRATE_LABEL(" Apply all migrations: ") +
- (", ".join(sorted(set(a for a, n in targets))) or "(none)")
+ (", ".join(sorted({a for a, n in targets})) or "(none)")
)
else:
if targets[0][1] is None: