Skip to content

Commit 8e9e657

Browse files
committed
Apply Jitse suggestions.
Check that the kernel is ready before resetting the shell or setting the color scheme in the shell widget.
1 parent 6f4eeff commit 8e9e657

File tree

1 file changed

+3
-3
lines changed
  • spyder/plugins/ipythonconsole/widgets

1 file changed

+3
-3
lines changed

spyder/plugins/ipythonconsole/widgets/shell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,9 @@ def set_color_scheme(self, color_scheme, reset=True):
749749
self.set_bracket_matcher_color_scheme(color_scheme)
750750
self.style_sheet, dark_color = create_qss_style(color_scheme)
751751
self.syntax_style = color_scheme
752+
if not self.spyder_kernel_ready:
753+
# Will be sent later
754+
return
752755
if reset:
753756
# Don't clear console and show a message instead to prevent
754757
# removing important content from users' consoles.
@@ -758,9 +761,6 @@ def set_color_scheme(self, color_scheme, reset=True):
758761
"\n\nNote: Clearing the console is necessary to fully apply "
759762
"the new syntax style you selected."
760763
)
761-
if not self.spyder_kernel_ready:
762-
# Will be sent later
763-
return
764764
self.set_kernel_configuration(
765765
"color scheme", "dark" if not dark_color else "light"
766766
)

0 commit comments

Comments
 (0)