Skip to content

Commit

Permalink
Fix linting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
SupImDos committed Mar 27, 2024
1 parent a0b2859 commit 151dccf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/drf_yasg/inspectors/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def get_queryset_from_view(view, serializer=None):

if queryset is not None and serializer is not None:
# make sure the view is actually using *this* serializer
assert type(serializer) == call_view_method(view, 'get_serializer_class', 'serializer_class')
assert type(serializer) is call_view_method(view, 'get_serializer_class', 'serializer_class')

return queryset
except Exception: # pragma: no cover
Expand Down
4 changes: 2 additions & 2 deletions src/drf_yasg/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class SwaggerDict(OrderedDict):
def __init__(self, **attrs):
super(SwaggerDict, self).__init__()
self._extras__ = attrs
if type(self) == SwaggerDict:
if type(self) is SwaggerDict:
self._insert_extras__()

def __setattr__(self, key, value):
Expand Down Expand Up @@ -516,7 +516,7 @@ def __init__(self, resolver, name, scope, expected_type, ignore_unresolved=False
:param bool ignore_unresolved: do not throw if the referenced object does not exist
"""
super(_Ref, self).__init__()
assert not type(self) == _Ref, "do not instantiate _Ref directly"
assert type(self) is not _Ref, "do not instantiate _Ref directly"
ref_name = "#/{scope}/{name}".format(scope=scope, name=name)
if not ignore_unresolved:
obj = resolver.get(name, scope)
Expand Down
2 changes: 1 addition & 1 deletion src/drf_yasg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def force_real_str(s, encoding='utf-8', strings_only=False, errors='strict'):
"""
if s is not None:
s = force_str(s, encoding, strings_only, errors)
if type(s) != str:
if type(s) is not str: # noqa: E721
s = '' + s

# Remove common indentation to get the correct Markdown rendering
Expand Down

0 comments on commit 151dccf

Please sign in to comment.