Skip to content

Commit

Permalink
Handle all possible exceptions when trying to import the debugger (#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille authored Sep 13, 2022
1 parent 8d3c88b commit 861b124
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ipykernel/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
_is_debugpy_available = True
except ImportError:
_is_debugpy_available = False
except Exception as e:
# We cannot import the module where the DebuggerInitializationError
# is defined
if e.__class__.__name__ == "DebuggerInitializationError":
_is_debugpy_available = False
else:
raise e


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

0 comments on commit 861b124

Please sign in to comment.