1
0
mirror of https://github.com/django/django.git synced 2025-01-26 18:19:18 +00:00

[4.2.x] Fixed warnings per flake8 6.1.0.

Backport of 22b0b73c7732ba67db4e69fd9fa75aad84c8e5c4 from main
This commit is contained in:
Mariusz Felisiak 2023-07-30 16:17:07 +02:00
parent 739da73164
commit 8db9a0b5a0
3 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-eslint

View File

@ -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",
@ -309,7 +309,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")
):

View File

@ -242,7 +242,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)