cpython/Python
Eric Snow b3d25df8d3
gh-105716: Fix _PyInterpreterState_IsRunningMain() For Embedders (gh-117140)
When I added _PyInterpreterState_IsRunningMain() and friends last year, I tried to accommodate applications that embed Python but don't call _PyInterpreterState_SetRunningMain() (not that they're expected to).  That mostly worked fine until my recent changes in gh-117049, where the subtleties with the fallback code led to failures; the change ended up breaking test_tools.test_freeze, which exercises a basic embedding situation.

The simplest fix is to drop the fallback code I originally added to _PyInterpreterState_IsRunningMain() (and later to _PyThreadState_IsRunningMain()).  I've kept the fallback in the _xxsubinterpreters module though.  I've also updated Py_FrozenMain() to call _PyInterpreterState_SetRunningMain().
2024-03-21 18:20:20 -06:00
..
clinic
frozen_modules
_warnings.c gh-116664: Ensure thread-safe dict access in _warnings (#116768) 2024-03-18 09:37:48 +00:00
adaptive.md
asdl.c
asm_trampoline.S
assemble.c
ast.c
ast_opt.c
ast_unparse.c
bltinmodule.c gh-116437: Use new C API PyDict_Pop() to simplify the code (GH-116438) 2024-03-07 11:21:08 +02:00
bootstrap_hash.c
brc.c gh-112175: Add eval_breaker to PyThreadState (#115194) 2024-02-20 09:57:48 -05:00
bytecodes.c GH-115802: Reduce the size of _INIT_CALL_PY_EXACT_ARGS. (GH-116856) 2024-03-15 17:16:30 +00:00
ceval.c gh-115756: make PyCode_GetFirstFree an unstable API (GH-115781) 2024-03-19 09:20:38 +00:00
ceval_gil.c gh-116522: Refactor _PyThreadState_DeleteExcept (#117131) 2024-03-21 11:21:02 -07:00
ceval_macros.h gh-116098: Revert "gh-107674: Improve performance of sys.settrace (GH-114986)" (GH-116178) 2024-03-01 07:46:33 +01:00
codecs.c
compile.c gh-115756: make PyCode_GetFirstFree an unstable API (GH-115781) 2024-03-19 09:20:38 +00:00
condvar.h
context.c gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist (gh-115505) 2024-02-16 01:01:36 +00:00
critical_section.c
crossinterp.c gh-111696, PEP 737: Add PyType_GetModuleName() function (#116824) 2024-03-14 18:17:43 +00:00
crossinterp_data_lookup.h gh-76785: Improved Subinterpreters Compatibility with 3.12 (gh-115424) 2024-02-13 14:56:49 -07:00
crossinterp_exceptions.h gh-76785: Improved Subinterpreters Compatibility with 3.12 (gh-115424) 2024-02-13 14:56:49 -07:00
dtoa.c
dup2.c
dynamic_annotations.c
dynload_hpux.c
dynload_shlib.c
dynload_stub.c
dynload_win.c
emscripten_signal.c
emscripten_trampoline.c
errors.c
executor_cases.c.h GH-115802: Reduce the size of _INIT_CALL_PY_EXACT_ARGS. (GH-116856) 2024-03-15 17:16:30 +00:00
fileutils.c
flowgraph.c gh-115796: fix exception table construction in _testinternalcapi.assemble_code_object (#115797) 2024-02-22 12:36:44 +00:00
formatter_unicode.c
frame.c GH-116098: Remove dead frame object creation code (GH-116687) 2024-03-12 23:35:28 +00:00
frozen.c gh-108716: Cleanup remaining deepfreeze infrastructure (#116919) 2024-03-18 11:13:11 -07:00
frozenmain.c gh-105716: Fix _PyInterpreterState_IsRunningMain() For Embedders (gh-117140) 2024-03-21 18:20:20 -06:00
future.c
gc.c GH-108362: Incremental Cycle GC (GH-116206) 2024-03-20 08:54:42 +00:00
gc_free_threading.c GH-108362: Incremental Cycle GC (GH-116206) 2024-03-20 08:54:42 +00:00
gc_gil.c gh-111968: Rename freelist related struct names to Eric's suggestion (gh-115329) 2024-02-14 00:32:51 +00:00
generated_cases.c.h GH-115802: Reduce the size of _INIT_CALL_PY_EXACT_ARGS. (GH-116856) 2024-03-15 17:16:30 +00:00
getargs.c gh-116447: Fix possible UB in arraymodule and getargs (#116459) 2024-03-08 13:49:52 +03:00
getcompiler.c
getcopyright.c
getopt.c
getplatform.c
getversion.c
hamt.c
hashtable.c
import.c GH-108362: Incremental Cycle GC (GH-116206) 2024-03-20 08:54:42 +00:00
importdl.c
initconfig.c gh-117041: Add "-X gil" in the Python CLI help (GH-117042) 2024-03-19 23:30:25 +02:00
instrumentation.c gh-115832: Fix instrumentation version mismatch during interpreter shutdown (#115856) 2024-03-04 11:29:39 -05:00
intrinsics.c
jit.c GH-116017: Put JIT code and data on the same page (GH-116845) 2024-03-19 08:47:28 -07:00
legacy_tracing.c
lock.c gh-114271: Fix race in Thread.join() (#114839) 2024-03-16 13:56:30 +01:00
marshal.c
modsupport.c
mysnprintf.c
mystrtoul.c
object_stack.c gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist (gh-115505) 2024-02-16 01:01:36 +00:00
opcode_targets.h gh-116381: Remove bad specializations, add fail stats (GH-116464) 2024-03-08 00:21:21 +08:00
optimizer.c gh-117045: Add code object to function version cache (#117028) 2024-03-21 12:37:41 -07:00
optimizer_analysis.c gh-117045: Add code object to function version cache (#117028) 2024-03-21 12:37:41 -07:00
optimizer_bytecodes.c gh-117045: Add code object to function version cache (#117028) 2024-03-21 12:37:41 -07:00
optimizer_cases.c.h gh-117045: Add code object to function version cache (#117028) 2024-03-21 12:37:41 -07:00
optimizer_symbols.c GH-115819: Eliminate Boolean guards when value is known (GH-116355) 2024-03-05 15:06:00 +00:00
parking_lot.c gh-108724: Fix _PySemaphore_Wait call during thread deletion (#116483) 2024-03-08 15:26:36 -05:00
pathconfig.c
perf_trampoline.c
preconfig.c
pyarena.c
pyctype.c
pyfpe.c
pyhash.c
pylifecycle.c gh-116522: Refactor _PyThreadState_DeleteExcept (#117131) 2024-03-21 11:21:02 -07:00
pymath.c
pystate.c gh-105716: Fix _PyInterpreterState_IsRunningMain() For Embedders (gh-117140) 2024-03-21 18:20:20 -06:00
pystrcmp.c
pystrhex.c
pystrtod.c
Python-ast.c gh-116437: Use new C API PyDict_Pop() to simplify the code (GH-116438) 2024-03-07 11:21:08 +02:00
Python-tokenize.c
pythonrun.c gh-116437: Use new C API PyDict_Pop() to simplify the code (GH-116438) 2024-03-07 11:21:08 +02:00
pytime.c gh-63207: Use GetSystemTimePreciseAsFileTime() in time.time() (#116822) 2024-03-18 17:13:01 +01:00
qsbr.c gh-115103: Fix unregistering of QSBR state (#116480) 2024-03-08 12:39:53 -05:00
README
specialize.c gh-116996: Add pystats about _Py_uop_analyse_and_optimize (GH-116997) 2024-03-22 01:27:46 +08:00
stdlib_module_names.h
structmember.c
suggestions.c
symtable.c gh-96497: Mangle name before symtable lookup in 'symtable_extend_namedexpr_scope' (GH-96561) 2024-02-17 12:06:31 +00:00
sysmodule.c gh-116167: Allow disabling the GIL with PYTHON_GIL=0 or -X gil=0 (#116338) 2024-03-11 11:02:58 -04:00
thread.c gh-110850: Cleanup PyTime API: PyTime_t are nanoseconds (#115753) 2024-02-21 11:46:00 +01:00
thread_nt.h gh-116012: Preserve GetLastError() across calls to TlsGetValue on Windows (GH-116014) 2024-02-28 13:58:25 +00:00
thread_pthread.h gh-112536: Add TSAN builds on Github Actions (#116872) 2024-03-16 11:10:37 +01:00
thread_pthread_stubs.h
tier2_engine.md Docs: fix spelling of the word 'transferring' (#116641) 2024-03-13 23:53:32 +01:00
traceback.c
tracemalloc.c
vm-state.md

Miscellaneous source files for the main Python shared library