summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-12 08:52:23 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-12 08:55:06 +0200
commit48ed73fb74213ba9ae2fdcc42d18a5a3e7737fe0 (patch)
tree5cf619600c1e8462f19b340e83ab733beef377bf /django
parent16bdb6b7baf884fad6885db18be78a69a55317a5 (diff)
[3.0.x] Fixed E128, E741 flake8 warnings.
Backport of 0668164b4ac93a5be79f5b87fae83c657124d9ab from master.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/options.py2
-rw-r--r--django/core/mail/message.py4
-rw-r--r--django/core/management/commands/compilemessages.py2
-rw-r--r--django/forms/widgets.py2
-rw-r--r--django/http/request.py2
-rw-r--r--django/utils/dateformat.py6
-rw-r--r--django/utils/topological_sort.py4
7 files changed, 11 insertions, 11 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 795d20f96a..284498f665 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -1059,7 +1059,7 @@ class ModelAdmin(BaseModelAdmin):
level = getattr(messages.constants, level.upper())
except AttributeError:
levels = messages.constants.DEFAULT_TAGS.values()
- levels_repr = ', '.join('`%s`' % l for l in levels)
+ levels_repr = ', '.join('`%s`' % level for level in levels)
raise ValueError(
'Bad message level string: `%s`. Possible values are: %s'
% (level, levels_repr)
diff --git a/django/core/mail/message.py b/django/core/mail/message.py
index e2bd712f56..607eb4af0b 100644
--- a/django/core/mail/message.py
+++ b/django/core/mail/message.py
@@ -157,8 +157,8 @@ class SafeMIMEText(MIMEMixin, MIMEText):
def set_payload(self, payload, charset=None):
if charset == 'utf-8' and not isinstance(charset, Charset.Charset):
has_long_lines = any(
- len(l.encode()) > RFC5322_EMAIL_LINE_LENGTH_LIMIT
- for l in payload.splitlines()
+ len(line.encode()) > RFC5322_EMAIL_LINE_LENGTH_LIMIT
+ for line in payload.splitlines()
)
# Quoted-Printable encoding has the side effect of shortening long
# lines, if any (#22561).
diff --git a/django/core/management/commands/compilemessages.py b/django/core/management/commands/compilemessages.py
index 00ab2db6fc..50d326c906 100644
--- a/django/core/management/commands/compilemessages.py
+++ b/django/core/management/commands/compilemessages.py
@@ -101,7 +101,7 @@ class Command(BaseCommand):
self.has_errors = False
for basedir in basedirs:
if locales:
- dirs = [os.path.join(basedir, l, 'LC_MESSAGES') for l in locales]
+ dirs = [os.path.join(basedir, locale, 'LC_MESSAGES') for locale in locales]
else:
dirs = [basedir]
locations = []
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 1976c201a9..a57ab56dda 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -140,7 +140,7 @@ class Media:
except CyclicDependencyError:
warnings.warn(
'Detected duplicate Media files in an opposite order: {}'.format(
- ', '.join(repr(l) for l in lists)
+ ', '.join(repr(list_) for list_ in lists)
), MediaOrderConflictWarning,
)
return list(all_items)
diff --git a/django/http/request.py b/django/http/request.py
index 98a51f57c8..156d525df8 100644
--- a/django/http/request.py
+++ b/django/http/request.py
@@ -338,7 +338,7 @@ class HttpRequest:
def close(self):
if hasattr(self, '_files'):
- for f in chain.from_iterable(l[1] for l in self._files.lists()):
+ for f in chain.from_iterable(list_[1] for list_ in self._files.lists()):
f.close()
# File-like and iterator interface.
diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py
index 29893fe6b9..51d5853ece 100644
--- a/django/utils/dateformat.py
+++ b/django/utils/dateformat.py
@@ -123,7 +123,7 @@ class TimeFormat(Formatter):
"Minutes; i.e. '00' to '59'"
return '%02d' % self.data.minute
- def O(self): # NOQA: E743
+ def O(self): # NOQA: E743, E741
"""
Difference to Greenwich time in hours; e.g. '+0200', '-0430'.
@@ -237,7 +237,7 @@ class DateFormat(TimeFormat):
"Month, textual, long; e.g. 'January'"
return MONTHS[self.data.month]
- def I(self): # NOQA: E743
+ def I(self): # NOQA: E743, E741
"'1' if Daylight Savings Time, '0' otherwise."
try:
if self.timezone and self.timezone.dst(self.data):
@@ -254,7 +254,7 @@ class DateFormat(TimeFormat):
"Day of the month without leading zeros; i.e. '1' to '31'"
return self.data.day
- def l(self): # NOQA: E743
+ def l(self): # NOQA: E743, E741
"Day of the week, textual, long; e.g. 'Friday'"
return WEEKDAYS[self.data.weekday()]
diff --git a/django/utils/topological_sort.py b/django/utils/topological_sort.py
index 3f8ea0f2e4..f7ce0e0d1d 100644
--- a/django/utils/topological_sort.py
+++ b/django/utils/topological_sort.py
@@ -27,10 +27,10 @@ def topological_sort_as_sets(dependency_graph):
todo.items() if node not in current}
-def stable_topological_sort(l, dependency_graph):
+def stable_topological_sort(nodes, dependency_graph):
result = []
for layer in topological_sort_as_sets(dependency_graph):
- for node in l:
+ for node in nodes:
if node in layer:
result.append(node)
return result