From e9084b3604bc35cc9380671e6348cafcab6759d7 Mon Sep 17 00:00:00 2001 From: Zach Sailer Date: Wed, 29 Mar 2023 21:24:10 -0700 Subject: [PATCH] add type to context var --- jupyter_server/base/handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jupyter_server/base/handlers.py b/jupyter_server/base/handlers.py index e91f1e36c9..c1a241a40f 100644 --- a/jupyter_server/base/handlers.py +++ b/jupyter_server/base/handlers.py @@ -3,7 +3,6 @@ # Distributed under the terms of the Modified BSD License. from __future__ import annotations -import contextvars import functools import inspect import ipaddress @@ -14,6 +13,7 @@ import traceback import types import warnings +from contextvars import ContextVar from http.client import responses from typing import TYPE_CHECKING, Awaitable from urllib.parse import urlparse @@ -67,7 +67,7 @@ def log(): return app_log -CURRENT_JUPYTER_HANDLER = contextvars.ContextVar("CURRENT_JUPYTER_HANDLER") +CURRENT_JUPYTER_HANDLER: ContextVar[JupyterHandler] = ContextVar("CURRENT_JUPYTER_HANDLER") class AuthenticatedHandler(web.RequestHandler):