Skip to content

Commit 765ddb3

Browse files
committed
BF: change logic so we can have just one else statement
1 parent 9d3ba8a commit 765ddb3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎IPython/terminal/interactiveshell.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,13 +951,13 @@ def enable_gui(self, gui=None):
951951
if self.active_eventloop == gui:
952952
# already installed; nothing to do.
953953
return
954-
elif self.active_eventloop.startswith('qt'):
955-
if gui == 'qt':
954+
if gui.startswith('qt'):
955+
if gui =='qt' and self.active_eventloop.startswith('qt'):
956956
# This means "requesting latest version". But you can't switch versions once
957957
# you've chosen one, so we just accept this if the event loop hook is
958958
# already *any* Qt version.
959959
return
960-
elif gui.startswith('qt'):
960+
elif self.active_eventloop.startswith('qt'):
961961
# Requesting a specific version of qt, but not the same version as the one
962962
# installed last time. We run this code, which will let the Qt importing
963963
# logic tell the user that the version cannot be switched. Effectively, we

0 commit comments

Comments
 (0)