@@ -25,11 +25,14 @@ static Delegates()
25
25
PyThreadState_Get = ( delegate * unmanaged[ Cdecl] < PyThreadState * > ) GetFunctionByName ( nameof ( PyThreadState_Get ) , GetUnmanagedDll ( _PythonDll ) ) ;
26
26
try
27
27
{
28
- _PyThreadState_UncheckedGet = ( delegate * unmanaged[ Cdecl] < PyThreadState * > ) GetFunctionByName ( nameof ( _PyThreadState_UncheckedGet ) , GetUnmanagedDll ( _PythonDll ) ) ;
28
+ // Up until Python 3.13, this function was private and named
29
+ // slightly differently.
30
+ PyThreadState_GetUnchecked = ( delegate * unmanaged[ Cdecl] < PyThreadState * > ) GetFunctionByName ( "_PyThreadState_UncheckedGet" , GetUnmanagedDll ( _PythonDll ) ) ;
29
31
}
30
32
catch ( MissingMethodException )
31
33
{
32
- // Not supported in Python 3.13 anymore
34
+
35
+ PyThreadState_GetUnchecked = ( delegate * unmanaged[ Cdecl] < PyThreadState * > ) GetFunctionByName ( nameof ( PyThreadState_GetUnchecked ) , GetUnmanagedDll ( _PythonDll ) ) ;
33
36
}
34
37
try
35
38
{
@@ -320,7 +323,7 @@ static Delegates()
320
323
internal static delegate * unmanaged[ Cdecl] < PyThreadState * , void > Py_EndInterpreter { get ; }
321
324
internal static delegate * unmanaged[ Cdecl] < PyInterpreterState * , PyThreadState * > PyThreadState_New { get ; }
322
325
internal static delegate * unmanaged[ Cdecl] < PyThreadState * > PyThreadState_Get { get ; }
323
- internal static delegate * unmanaged[ Cdecl] < PyThreadState * > _PyThreadState_UncheckedGet { get ; }
326
+ internal static delegate * unmanaged[ Cdecl] < PyThreadState * > PyThreadState_GetUnchecked { get ; }
324
327
internal static delegate * unmanaged[ Cdecl] < int > PyGILState_Check { get ; }
325
328
internal static delegate * unmanaged[ Cdecl] < PyGILState > PyGILState_Ensure { get ; }
326
329
internal static delegate * unmanaged[ Cdecl] < PyGILState , void > PyGILState_Release { get ; }