mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
[4.1.x] Fixed warnings per flake8 6.1.0.
Backport of 22b0b73c77
from main.
This commit is contained in:
parent
05d78acb9c
commit
52533346d2
3 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@ repos:
|
|||
hooks:
|
||||
- id: isort
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 5.0.0
|
||||
rev: 6.1.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
- repo: https://github.com/pre-commit/mirrors-eslint
|
||||
|
|
|
@ -97,7 +97,7 @@ class Extract(TimezoneMixin, Transform):
|
|||
"TimeField, or DurationField."
|
||||
)
|
||||
# Passing dates to functions expecting datetimes is most likely a mistake.
|
||||
if type(field) == DateField and copy.lookup_name in (
|
||||
if type(field) is DateField and copy.lookup_name in (
|
||||
"hour",
|
||||
"minute",
|
||||
"second",
|
||||
|
@ -296,7 +296,7 @@ class TruncBase(TimezoneMixin, Transform):
|
|||
has_explicit_output_field = (
|
||||
class_output_field or field.__class__ is not copy.output_field.__class__
|
||||
)
|
||||
if type(field) == DateField and (
|
||||
if type(field) is DateField and (
|
||||
isinstance(output_field, DateTimeField)
|
||||
or copy.kind in ("hour", "minute", "second", "time")
|
||||
):
|
||||
|
|
|
@ -238,7 +238,7 @@ class SchemaTests(TransactionTestCase):
|
|||
"SELECT {} FROM {};".format(field_name, model._meta.db_table)
|
||||
)
|
||||
database_default = cursor.fetchall()[0][0]
|
||||
if cast_function and type(database_default) != type(expected_default):
|
||||
if cast_function and type(database_default) is not type(expected_default):
|
||||
database_default = cast_function(database_default)
|
||||
self.assertEqual(database_default, expected_default)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue