Skip to content
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

Fix usage of await #106

Merged
merged 2 commits into from
Jan 22, 2024
Merged
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
5 changes: 3 additions & 2 deletions jupyter_server_terminals/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import typing as t

from jupyter_core.utils import ensure_async
from jupyter_server._tz import utcnow
from jupyter_server.auth.utils import warn_disabled_authorization
from jupyter_server.base.handlers import JupyterHandler
Expand Down Expand Up @@ -54,11 +55,11 @@ async def get(self, *args: t.Any, **kwargs: t.Any) -> None:
raise web.HTTPError(404)
resp = super().get(*args, **kwargs)
if resp is not None:
await resp
await ensure_async(resp) # type:ignore[arg-type]

async def on_message(self, message: t.Any) -> None: # type:ignore[override]
"""Handle a socket message."""
await super().on_message(message)
await ensure_async(super().on_message(message)) # type:ignore[arg-type]
self._update_activity()

def write_message(self, message: t.Any, binary: bool = False) -> None: # type:ignore[override]
Expand Down
Loading