Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove setting of the eventloop function in the InProcessKernel #781

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

rayosborn
Copy link
Contributor

@rayosborn rayosborn commented Oct 6, 2021

The enable_gui function of the InProcessInteractiveShell calls a function of the same name in 'eventloops.py', which sets kernel.eventloop to a function defined by the requested GUI. For the InProcessKernel, kernel.eventloop should always be set to None. Otherwise, commands typed in the shell trigger a call to the parent kernel class's enter_eventloop function, which causes an exception because attributes like io_loop and msg_queue are not defined by the InProcessKernel.

This PR removes the call to the enable_gui function in 'eventloops.py' since the Qt event loop should already be running in the InProcessKernel.

This is designed to fix #780 and is possibly related to #775 and #319.

If the InProcessInteractiveShell version of `enable_gui` calls the parent function in eventloops.py, it initializes `kernel.eventloop`, whereas it should be `None` in the InProcessKernel. This triggers exceptions in the kernel's `entering_eventloop` function.
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @rayosborn!

@blink1073 blink1073 added the bug label Oct 7, 2021
@blink1073 blink1073 added this to the 6.4 milestone Oct 7, 2021
@blink1073 blink1073 merged commit d6e890d into ipython:master Oct 7, 2021
@rayosborn rayosborn deleted the fix-inprocess-enable-gui branch October 7, 2021 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kernel eventloop function incorrectly initialized by the InProcessInteractiveShell
3 participants