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

Missing _thread._is_main_interpreter() #390

Closed
ericsnowcurrently opened this issue Dec 7, 2023 · 5 comments
Closed

Missing _thread._is_main_interpreter() #390

ericsnowcurrently opened this issue Dec 7, 2023 · 5 comments

Comments

@ericsnowcurrently
Copy link

(See python/cpython#112826.)

In the CPython main branch (i.e. 3.13+), as of python/cpython#112661, the threading module expects the _thread module to provide _is_main_interpreter(). Apparently it doesn't.

I'd like to make sure that gets fixed as soon as possible. I'd be glad to open a PR but it would help to first have some instruction on where to look for the relevant code.

FYI, the same expectation applies with the upcoming CPython 3.12.1 release, as of python/cpython#110707.

@jamadden
Copy link
Contributor

jamadden commented Dec 8, 2023

Maybe you're thinking of gevent? greenlet doesn't modify or replace any stdlib modules.

@ericsnowcurrently
Copy link
Author

Hmm, I'm going off of what someone reported on python/cpython#112826. I didn't look too closely though. I'll double-check. Thanks for the pointer.

@jamadden
Copy link
Contributor

I can confirm that is an eventlet-specific problem. Neither greenlet nor gevent messes with that attribute.

$ python -c 'import sys; import gevent.monkey; import _thread; print(sys.version); gevent.monkey.patch_all(); print(_thread._is_main_interpreter)'
3.12.1 (main, Dec 12 2023, 13:05:57) [Clang 15.0.0 (clang-1500.1.0.2.5)]
<built-in function _is_main_interpreter>

@ericsnowcurrently
Copy link
Author

thanks for looking that up

@jamadden
Copy link
Contributor

Thanks for the heads-up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants