diff options
author | Kumar Aditya <kumaraditya@python.org> | 2024-11-29 09:47:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-29 09:47:16 (GMT) |
commit | 762c603a866146afc7db2591fb49605e0858e9b1 (patch) | |
tree | ef2776e590d18e250a6ed5ee09f3bfdfb2d606f1 /Python | |
parent | dd3a87d2a8f8750978359a99de2c5cb2168351d1 (diff) | |
download | cpython-762c603a866146afc7db2591fb49605e0858e9b1.zip cpython-762c603a866146afc7db2591fb49605e0858e9b1.tar.gz cpython-762c603a866146afc7db2591fb49605e0858e9b1.tar.bz2 |
gh-126881: fix finalization of dtoa state (#126904)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pylifecycle.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 23882d0..ceb30e9 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1888,7 +1888,6 @@ finalize_interp_clear(PyThreadState *tstate) _PyXI_Fini(tstate->interp); _PyExc_ClearExceptionGroupType(tstate->interp); _Py_clear_generic_types(tstate->interp); - _PyDtoa_Fini(tstate->interp); /* Clear interpreter state and all thread states */ _PyInterpreterState_Clear(tstate); @@ -1910,6 +1909,9 @@ finalize_interp_clear(PyThreadState *tstate) finalize_interp_types(tstate->interp); + /* Finalize dtoa at last so that finalizers calling repr of float doesn't crash */ + _PyDtoa_Fini(tstate->interp); + /* Free any delayed free requests immediately */ _PyMem_FiniDelayed(tstate->interp); |