Skip to content

Upgrade flake8 in pre-commit #1941

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
wants to merge 1 commit into from
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 @@ -11,7 +11,7 @@ repos:
language_version: python3
exclude: "(tests/utils/stacks/linenos.py|tests/utils/stacks/linenos2.py|tests/contrib/grpc/grpc_app/.*pb2.*.py)"
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.1.0
hooks:
- id: flake8
exclude: "(tests/utils/stacks/linenos.py|tests/utils/stacks/linenos2.py|tests/contrib/grpc/grpc_app/.*pb2.*.py)"
Expand Down
4 changes: 3 additions & 1 deletion elasticapm/contrib/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ async def __call__(self, scope: "Scope", receive: "ASGIReceiveCallable", send: "
body = str(body_raw, errors="ignore")

# Dispatch to the ASGI callable
async def wrapped_receive():
async def new_wrapped_receive():
if messages:
return messages.pop(0)

# Once that's done we can just await any other messages.
return await receive()

wrapped_receive = new_wrapped_receive

await set_context(lambda: self.get_data_from_request(scope, constants.TRANSACTION, body), "request")

try:
Expand Down