-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
MNT: Remove dummy_threading because threading is always available #23073
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
Conversation
With Python 3.7 and above, the threading module is always available.
Are we sure this will not break pyiodide? |
Not positive, but it looks like they've removed their dummy_threading patches? Ping @rth for comment on whether this will break Pyodide because it looks like you did some of the threading work over in Pyodide. |
I also side-banded @mdboom , we are good to go here! Merging over the OSX failures which are due to tk installation issues. |
For Pyodide it should be OK, since indeed lately importing I think the only thing that could be improved is to add try:
timer.start()
except RuntimeError:
pass in the FontManager init, as otherwise starting that thread would fail in Pyodide, >>> timer = threading.Timer(1, lambda x: print('a'))
>>> timer.start()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/lib/python3.10/threading.py", line 928, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread ( |
Would changing the warning timer to I don't see a major issue with adding the try/except either, the only minor issue is that someone else will come along again next time and say it isn't necessary because the CPython docs say it should be available :) |
I would rather try...except than go down the signal path. I think of this is a secondary feature (it is warning that building the font cache is going slow which if you have oodles of fonts can take a long time and look like a process hang) so if it is degraded on pyodide that is OK and we should un-break them as simply as possible on our side. |
PR Summary
With Python 3.7 and above, the threading module is always available.
https://docs.python.org/3.7/library/dummy_threading.html
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).