]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.15] gh-150579: use lazy imports for concurrent.futures (GH-150585) (#152975)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 4 Jul 2026 03:20:49 +0000 (05:20 +0200)
committerGitHub <noreply@github.com>
Sat, 4 Jul 2026 03:20:49 +0000 (20:20 -0700)
commit2dd5d4e1ec78c56e4ee05a6fc3aa345a76ec457c
tree16bd6a0e76acb3827b75bf774ae1e571cc85bd48
parent8d08232817dfb14e86f26087f6f090da6f48884a
[3.15] gh-150579: use lazy imports for concurrent.futures (GH-150585) (#152975)

gh-150579: use lazy imports for concurrent.futures (GH-150585)

This module has a manual lazy import hack using `__getattr__`. Now that lazy imports exist and cannot be disabled, this could use lazy imports instead.

Key differences: this will now show up in sys.lazy_modules when accessed. Error messages should be a bit better without the wrapper `__getattr__` involved.  That's the only differences I can think of.
(cherry picked from commit 423ae0ff36c6485f722e0fe3274124dc3df09862)

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Lib/concurrent/futures/__init__.py
Misc/NEWS.d/next/Library/2026-07-03-17-29-34.gh-issue-150579.0tLpQukIU.rst [new file with mode: 0644]