From c02affd4cf75063ff113c212389238e2896fb5c8 Mon Sep 17 00:00:00 2001 From: Rich Chiodo false Date: Thu, 25 Jul 2024 10:22:39 -0700 Subject: [PATCH] Skip importing sessions unless type checking --- src/debugpy/adapter/components.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/debugpy/adapter/components.py b/src/debugpy/adapter/components.py index ed01b6e7..28d22721 100644 --- a/src/debugpy/adapter/components.py +++ b/src/debugpy/adapter/components.py @@ -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