diff --git a/ipykernel/debugger.py b/ipykernel/debugger.py index 2338f5b17..1a939ae33 100644 --- a/ipykernel/debugger.py +++ b/ipykernel/debugger.py @@ -31,8 +31,9 @@ except ImportError: _is_debugpy_available = False except Exception as e: - from pydevd import _pydev_bundle from _pydev_bundle._pydev_saved_modules import DebuggerInitializationError + from pydevd import _pydev_bundle + if isinstance(e, DebuggerInitializationError): _is_debugpy_available = False else: