Skip to content

Commit 861b124

Browse files
authored
Handle all possible exceptions when trying to import the debugger (#987)
1 parent 8d3c88b commit 861b124

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

ipykernel/debugger.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
_is_debugpy_available = True
3131
except ImportError:
3232
_is_debugpy_available = False
33+
except Exception as e:
34+
# We cannot import the module where the DebuggerInitializationError
35+
# is defined
36+
if e.__class__.__name__ == "DebuggerInitializationError":
37+
_is_debugpy_available = False
38+
else:
39+
raise e
40+
3341

3442
# Required for backwards compatiblity
3543
ROUTING_ID = getattr(zmq, "ROUTING_ID", None) or zmq.IDENTITY

0 commit comments

Comments
 (0)