@@ -2,9 +2,10 @@ use crate::{PyConfig, PyPreConfig, PyStatus, Py_ssize_t};
22use libc:: wchar_t;
33use std:: ffi:: { c_char, c_int} ;
44
5- // "private" functions in cpython/pylifecycle.h accepted in PEP 587
65extern "C" {
7- // skipped _Py_SetStandardStreamEncoding;
6+
7+ // skipped Py_FrozenMain
8+
89 pub fn Py_PreInitialize ( src_config : * const PyPreConfig ) -> PyStatus ;
910 pub fn Py_PreInitializeFromBytesArgs (
1011 src_config : * const PyPreConfig ,
@@ -16,34 +17,14 @@ extern "C" {
1617 argc : Py_ssize_t ,
1718 argv : * mut * mut wchar_t ,
1819 ) -> PyStatus ;
19- pub fn _Py_IsCoreInitialized ( ) -> c_int ;
2020
2121 pub fn Py_InitializeFromConfig ( config : * const PyConfig ) -> PyStatus ;
22- pub fn _Py_InitializeMain ( ) -> PyStatus ;
2322
2423 pub fn Py_RunMain ( ) -> c_int ;
2524
2625 pub fn Py_ExitStatusException ( status : PyStatus ) -> !;
2726
28- // skipped _Py_RestoreSignals
29-
3027 // skipped Py_FdIsInteractive
31- // skipped _Py_FdIsInteractive
32-
33- // skipped _Py_SetProgramFullPath
34-
35- // skipped _Py_gitidentifier
36- // skipped _Py_getversion
37-
38- // skipped _Py_IsFinalizing
39-
40- // skipped _PyOS_URandom
41- // skipped _PyOS_URandomNonblock
42-
43- // skipped _Py_CoerceLegacyLocale
44- // skipped _Py_LegacyLocaleDetected
45- // skipped _Py_SetLocaleFromEnv
46-
4728}
4829
4930#[ cfg( Py_3_12 ) ]
@@ -76,14 +57,19 @@ pub const _PyInterpreterConfig_INIT: PyInterpreterConfig = PyInterpreterConfig {
7657 gil : PyInterpreterConfig_OWN_GIL ,
7758} ;
7859
60+ // https://github.com/python/cpython/blob/902de283a8303177eb95bf5bc252d2421fcbd758/Include/cpython/pylifecycle.h#L63-L65
61+ #[ cfg( Py_3_12 ) ]
62+ const _PyInterpreterConfig_LEGACY_CHECK_MULTI_INTERP_EXTENSIONS: c_int =
63+ if cfg ! ( Py_GIL_DISABLED ) { 1 } else { 0 } ;
64+
7965#[ cfg( Py_3_12 ) ]
8066pub const _PyInterpreterConfig_LEGACY_INIT: PyInterpreterConfig = PyInterpreterConfig {
8167 use_main_obmalloc : 1 ,
8268 allow_fork : 1 ,
8369 allow_exec : 1 ,
8470 allow_threads : 1 ,
8571 allow_daemon_threads : 1 ,
86- check_multi_interp_extensions : 0 ,
72+ check_multi_interp_extensions : _PyInterpreterConfig_LEGACY_CHECK_MULTI_INTERP_EXTENSIONS ,
8773 gil : PyInterpreterConfig_SHARED_GIL ,
8874} ;
8975
@@ -96,4 +82,4 @@ extern "C" {
9682}
9783
9884// skipped atexit_datacallbackfunc
99- // skipped _Py_AtExit
85+ // skipped PyUnstable_AtExit
0 commit comments