Skip to content

Commit

Permalink
IPython console: Avoid error when restarting external kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Oct 20, 2023
1 parent 39dc4c4 commit f68ec70
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions spyder/plugins/ipythonconsole/widgets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,13 @@ def _finalise_restart(self, reset=False):
# Aborting!
return

# Start autorestart mechanism
sw.kernel_manager.autorestart = True
sw.kernel_manager.start_restarter()
# Start autorestart mechanism.
# Note: We need to check for kernel_manager in case the kernel is
# not managed by us.
# Fixes spyder-ide/spyder#21165
if sw.kernel_manager:
sw.kernel_manager.autorestart = True
sw.kernel_manager.start_restarter()

# For spyder-ide/spyder#6235, IPython was changing the
# setting of %colors on windows by assuming it was using a
Expand Down

0 comments on commit f68ec70

Please sign in to comment.