Skip importing sessions unless type checking

This commit is contained in:
Rich Chiodo false 2024-07-25 10:22:39 -07:00
parent fddf0de4fb
commit c02affd4cf

View file

@ -3,9 +3,12 @@
# for license information.
import functools
from typing import Type, TypeVar, Union, cast
from typing import TYPE_CHECKING, Type, TypeVar, Union, cast
from debugpy.adapter.sessions import Session
if TYPE_CHECKING:
# Dont import this during runtime. There's an order
# of imports issue that causes the debugger to hang.
from debugpy.adapter.sessions import Session
from debugpy.common import json, log, messaging, util