Skip to content

Commit

Permalink
Merge pull request #21441 from ccordoba12/issue-21165
Browse files Browse the repository at this point in the history
PR: Avoid error when restarting external kernel (IPython console)
  • Loading branch information
ccordoba12 authored Oct 21, 2023
2 parents 6b31570 + f68ec70 commit 6c66ba9
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 6c66ba9

Please sign in to comment.