-
-
Notifications
You must be signed in to change notification settings - Fork 397
Don't raise error when trying to create another Qt app for Qt eventloop #1071
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
Don't raise error when trying to create another Qt app for Qt eventloop #1071
Conversation
- This was making the `%matplotlib qt` fail in Spyder. - It was also generating a long traceback when trying to set another interactive backend (e.g. tk).
Use prints instead because these errors are not displayed to users but contain valuable information for them.
for more information, see https://pre-commit.ci
This avoids making that function run beyond the point where a certain message is printed.
b77bf3e to
9bc06be
Compare
|
@shaperilio,, this should be ready for review. @blink1073, I think the failure in the ipyparallel test suite is unrelated to this. Also, please wait until I can run the Spyder tests with this PR before merging it (I'll give you a ping when I have the chance to do that). |
|
I agree the |
|
@ccordoba12, fyi I added a commit to fix merge conflicts picked up from #1073 |
|
Thanks but your merge reverted some of the changes I made that fix the mentioned Spyder bug and improve other things. So, I need to drop it and do a merge that preserves what I did before. |
|
Ugh, sorry about that. |
ec39463 to
bf0aae3
Compare
|
No worries, I understand you wanted to check if everything was green here too after PR #1073. |
bf0aae3 to
0f8e1bb
Compare
|
@blink1073, I still don't understand the failure in IPyparallel, but the rest seems ok now. |
|
I got the same |
blink1073
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
|
Should we also remove Qt4 from ipython? |
|
Yeah, I think that's a good idea. PyQt4 is really outdated and it doesn't have wheels for the most recent Python versions. |
See ipython/ipykernel#1071 Note that it's still there if coming from `matplotlib`
This is a follow-up PR that fixes the
%matplotlib qtmagic in Spyder.Avoid raising
RuntimeError('Kernel already running a Qt event loop.')inmake_qt_app_for_kernel. This was the cause of the mentioned failure and it also generated an unnecessary traceback when trying to set another backend:Instead, replace that raise with a return.
Remove the Qt4 eventloop because it's ancient and not supported anymore.
Restore
loop_qt5function (and make it equal toloop_qt) because it's been public API for years and we're using it in Spyder-kernels.Avoid raising errors when calling
set_qt_api_env_from_guibecause they are not displayed to clients and instead use prints. Now you get this, for instance:Do some cleanup after PR ENH: add
%guisupport for Qt6 #1054.