Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ipykernel/eventloops.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def loop_qt4(kernel):
@register_integration('qt', 'qt5')
def loop_qt5(kernel):
"""Start a kernel with PyQt5 event loop integration."""
os.environ['QT_API'] = 'pyqt5'
if os.environ['QT_API'] not in ['pyqt5', 'pyside2']:
os.environ['QT_API'] = 'pyqt5'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't understand this change. I mean, this

if os.environ['QT_API']

assumes that QT_API is already in the environment, which is not always the case.

And this

not in ['pyqt5', 'pyside2']

seems to assume that the only possible values of QT_API can be pyqt5 and pyside2, when they can also be pyqt and pyside.

return loop_qt4(kernel)


Expand Down