@@ -25,11 +25,13 @@ 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
29
+ PyThreadState_UncheckedGet = ( delegate * unmanaged[ Cdecl] < PyThreadState * > ) GetFunctionByName ( "_PyThreadState_UncheckedGet" , GetUnmanagedDll ( _PythonDll ) ) ;
29
30
}
30
31
catch ( MissingMethodException )
31
32
{
32
- // Not supported in Python 3.13 anymore
33
+
34
+ PyThreadState_UncheckedGet = ( delegate * unmanaged[ Cdecl] < PyThreadState * > ) GetFunctionByName ( nameof ( PyThreadState_UncheckedGet ) , GetUnmanagedDll ( _PythonDll ) ) ;
33
35
}
34
36
try
35
37
{
@@ -321,7 +323,7 @@ static Delegates()
321
323
internal static delegate * unmanaged[ Cdecl] < PyThreadState * , void > Py_EndInterpreter { get ; }
322
324
internal static delegate * unmanaged[ Cdecl] < PyInterpreterState * , PyThreadState * > PyThreadState_New { get ; }
323
325
internal static delegate * unmanaged[ Cdecl] < PyThreadState * > PyThreadState_Get { get ; }
324
- internal static delegate * unmanaged[ Cdecl] < PyThreadState * > _PyThreadState_UncheckedGet { get ; }
326
+ internal static delegate * unmanaged[ Cdecl] < PyThreadState * > PyThreadState_UncheckedGet { get ; }
325
327
internal static delegate * unmanaged[ Cdecl] < int > PyGILState_Check { get ; }
326
328
internal static delegate * unmanaged[ Cdecl] < PyGILState > PyGILState_Ensure { get ; }
327
329
internal static delegate * unmanaged[ Cdecl] < PyGILState , void > PyGILState_Release { get ; }