Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-136380: Fix import behavior for concurrent.futures.InterpreterPoolExecutor#136381
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
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.
The downside of this is that_interpreters is now always imported.
Could you add tests? It is not easy, the tests should removeconcurrent and all its submodules recursively fromsys.module, and restoresys.module at the end. There are helpers for this somewhere, they can be private.
Uh oh!
There was an error while loading.Please reload this page.
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.
Misc/NEWS.d/next/Library/2025-07-07-22-12-32.gh-issue-136380.1b_nXl.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…b_nXl.rstCo-authored-by: Peter Bierma <zintensitydev@gmail.com>
Found a way to test it by running the test within a subprocess. |
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.
LGTM. 👍
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
I didn't mean to hit the update button, sorry about that. |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: sobolevn <mail@sobolevn.me>
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!
490eea0 intopython:mainUh oh!
There was an error while loading.Please reload this page.
…terPoolExecutor` (pythonGH-136381)(cherry picked from commit490eea0)Co-authored-by: AN Long <aisk@users.noreply.github.com>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: sobolevn <mail@sobolevn.me>
GH-136420 is a backport of this pull request to the3.14 branch. |
…eterPoolExecutor` (GH-136381) (#136420)gh-136380: Fix import behavior for `concurrent.futures.InterpreterPoolExecutor` (GH-136381)(cherry picked from commit490eea0)Co-authored-by: AN Long <aisk@users.noreply.github.com>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: sobolevn <mail@sobolevn.me>
…terPoolExecutor` (python#136381)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: sobolevn <mail@sobolevn.me>
…terPoolExecutor` (python#136381)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: sobolevn <mail@sobolevn.me>
…terPoolExecutor` (python#136381)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: sobolevn <mail@sobolevn.me>
This broke tab completion and |
…terPoolExecutor` (python#136381)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: sobolevn <mail@sobolevn.me>
…terPoolExecutor` (python#136381)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: sobolevn <mail@sobolevn.me>
…nterpreterPoolExecutor` (pythonGH-136381) (python#136420)pythongh-136380: Fix import behavior for `concurrent.futures.InterpreterPoolExecutor` (pythonGH-136381)(cherry picked from commit490eea0)Co-authored-by: AN Long <aisk@users.noreply.github.com>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: sobolevn <mail@sobolevn.me>
Uh oh!
There was an error while loading.Please reload this page.
It's hard to write the test, but on my local machine, when remove the
_interpretersmodule or raise aModuleNotFoundErrorin the try branch, the behavior is correct compare to a normal non-exist field:We must
import _interpretersin__init__.pyto determine whether to append theInterpreterPoolExecutorto__all__. This may have a negative impact on importing performance.