Fix warning with ipython 8.11 (was #35235)#35337
Conversation
|
Documentation preview for this PR is ready! 🎉 |
kiwifb
left a comment
There was a problem hiding this comment.
Already discussed before, and the corrections I suggested did allow the doc to build.
|
With ipython 8.12 there seem to be more changes that cause more tests to fail: |
I noticed these and I was wondering what to do about it. I don't see a way to avoid the messages OTOH, the message Note that Volker is already merging this PR in his tree, so I'll keep it as is and open a new PR for ipython 8.12. |
📚 Description
ipython 8.11 throws new warnings "UserWarning: Shell was already running a gui event loop for sage; switching to sage." when running some tests.
This is because sage indeed tries to install the same gui event loop for ipython again and again. The fix is checking if the ipython input hook is already set to the sage input hook, in that case we don't install the gui event loop again.
In the test, we run
install()twice so we can verify that running it multiple times won't cause a warning anymore.📝 Checklist
⌛ Dependencies
Replaces: #35235
Since gh doesn't allow to change the branch on a PR.