Skip to content

fix(compat): catch AttributeError since EntryPoints object has no get() #9167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 3.9.0
rev: 5.0.0
hooks:
- id: flake8
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion rest_framework/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def decorator(func):
# WrappedAPIView.__doc__ = func.doc <--- Not possible to do this

# api_view applied without (method_names)
assert not(isinstance(http_method_names, types.FunctionType)), \
assert not (isinstance(http_method_names, types.FunctionType)), \
'@api_view missing list of allowed HTTP methods'

# api_view applied with eg. string instead of list of strings
Expand Down
2 changes: 1 addition & 1 deletion tests/test_throttling.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def ensure_response_header_contains_proper_throttle_field(self, view, expected_h
if expect is not None:
assert response['Retry-After'] == expect
else:
assert not'Retry-After' in response
assert 'Retry-After' not in response

def test_seconds_fields(self):
"""
Expand Down