-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix issue with PyPy on macOS #12629
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
Fix issue with PyPy on macOS #12629
Conversation
A little background, copied from the PyPy issue:
PyPy uses a pure-python The relevant code path in tkinter (EnableEventHook and DisableEventHook) is commented out on PyPy. Other platforms perform properly without the hook, I do not know why the MacOS platform uses it on matplotlib. |
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.
This seems fine. However, I'm curious why we need these input hooks? What do they do, and why do we need them in the first place? Maybe they are obsolete, and can be removed for both pypy and cpython?
My guess is they were needed at one point to allow the tkinter event loop and the REPL event loop to play nicely. But then why were they MacOS only, unless at one point python vendored a broken version of tk on that platform? Maybe someone with the oldest python and MacOS matplotlib supports could verify the terminal and the canvas are both responsive after removing the callback |
Ok away from computer but maybe we should merge this as fixing pypy and then open the rest as a separate issue. |
@mdehoon, could you 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.
Pending on OSX developer confirming that this still works as expected on cpython.
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.
I can't see any problems w/ the macosx backend when I include this change, but I didn't test to death..
This is very tricky stuff; the backend may seem to work fine but you may notice problems later. |
Thanks @mdehoon. I checked and we definitely need these hooks for the non pypy work. |
This PR fixes the issue with
PyOS_InputHook
variable that is not defined in PyPy implementation:p.s.
The corresponding issue in PyPy bug tracking is https://bitbucket.org/pypy/pypy/issues/2327