cpython/Lib/test/test_interpreters
Miss Islington (bot) 2b1c0a76dc
[3.14] gh-135443: Sometimes Fall Back to __main__.__dict__ For Globals (gh-135593)
For several builtin functions, we now fall back to __main__.__dict__ for the globals
when there is no current frame and _PyInterpreterState_IsRunningMain() returns
true.  This allows those functions to be run with Interpreter.call().

The affected builtins:

* exec()
* eval()
* globals()
* locals()
* vars()
* dir()

We take a similar approach with "stateless" functions, which don't use any
global variables.

(cherry picked from commit a450a0ddec, AKA gh-135491)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-06-16 23:59:30 +00:00
..
__init__.py gh-117953: Skip test_interpreters properly without GIL (#120689) 2024-06-18 15:22:24 +00:00
__main__.py Fix trivial typo in test_interpreters (GH-113381) 2023-12-23 14:10:41 +00:00
test_api.py [3.14] gh-135443: Sometimes Fall Back to __main__.__dict__ For Globals (gh-135593) 2025-06-16 23:59:30 +00:00
test_channels.py [3.14] gh-134939: Add the concurrent.interpreters Module (gh-135414) 2025-06-12 08:19:26 -06:00
test_lifecycle.py [3.14] gh-134939: Add the concurrent.interpreters Module (gh-135414) 2025-06-12 08:19:26 -06:00
test_queues.py [3.14] gh-134939: Add the concurrent.interpreters Module (gh-135414) 2025-06-12 08:19:26 -06:00
test_stress.py [3.14] gh-134939: Add the concurrent.interpreters Module (gh-135414) 2025-06-12 08:19:26 -06:00
utils.py [3.14] gh-134939: Add the concurrent.interpreters Module (gh-135414) 2025-06-12 08:19:26 -06:00