Skip to content

Commit af1022a

Browse files
committed
Fix stable ABI things.
1 parent 25e1cf0 commit af1022a

5 files changed

Lines changed: 61 additions & 1 deletion

File tree

Doc/data/stable_abi.dat

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/pystate.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE);
120120
PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);
121121

122122

123-
/* PEP 788 -- Interpreter guards and views. */
123+
/* PEP 788 -- Protection against interpreter finalization */
124+
125+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 15)
124126

125127
typedef struct _PyInterpreterGuard PyInterpreterGuard;
126128
typedef struct _PyInterpreterView PyInterpreterView;
@@ -137,6 +139,8 @@ PyAPI_FUNC(PyThreadState *) PyThreadState_Ensure(PyInterpreterGuard *guard);
137139
PyAPI_FUNC(PyThreadState *) PyThreadState_EnsureFromView(PyInterpreterView *view);
138140
PyAPI_FUNC(void) PyThreadState_Release(PyThreadState *tstate);
139141

142+
#endif
143+
140144
#ifndef Py_LIMITED_API
141145
# define Py_CPYTHON_PYSTATE_H
142146
# include "cpython/pystate.h"

Lib/test/test_stable_abi_ctypes.py

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Misc/stable_abi.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,3 +2715,30 @@
27152715
# Note: The `_reserved` member of this struct is for interal use only.
27162716
# (The definition of 'full-abi' was clarified when this entry was added.)
27172717
struct_abi_kind = 'full-abi'
2718+
2719+
# PEP 788 finalization protection
2720+
2721+
[struct.PyInterpreterGuard]
2722+
added = '3.15'
2723+
struct_abi_kind = 'opaque'
2724+
[function.PyInterpreterGuard_FromCurrent]
2725+
added = '3.15'
2726+
[function.PyInterpreterGuard_FromView]
2727+
added = '3.15'
2728+
[function.PyInterpreterGuard_Close]
2729+
added = '3.15'
2730+
[struct.PyInterpreterView]
2731+
added = '3.15'
2732+
struct_abi_kind = 'opaque'
2733+
[function.PyInterpreterView_FromCurrent]
2734+
added = '3.15'
2735+
[function.PyInterpreterView_FromMain]
2736+
added = '3.15'
2737+
[function.PyInterpreterView_Close]
2738+
added = '3.15'
2739+
[function.PyThreadState_Ensure]
2740+
added = '3.15'
2741+
[function.PyThreadState_EnsureFromView]
2742+
added = '3.15'
2743+
[function.PyThreadState_Release]
2744+
added = '3.15'

PC/python3dll.c

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)