8000 Drop reference to Py_Main (#2504) · pythonnet/pythonnet@0ea1d29 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ea1d29

Browse files
authored
Drop reference to Py_Main (#2504)
Was only used in the console and might not be available in some embedding scenarios.
1 parent de7a1d2 commit 0ea1d29

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

src/runtime/Runtime.Delegates.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ static Delegates()
3535
PyGILState_Ensure = (delegate* unmanaged[Cdecl]<PyGILState>)GetFunctionByName(nameof(PyGILState_Ensure), GetUnmanagedDll(_PythonDll));
3636
PyGILState_Release = (delegate* unmanaged[Cdecl]<PyGILState, void>)GetFunctionByName(nameof(PyGILState_Release), GetUnmanagedDll(_PythonDll));
3737
PyGILState_GetThisThreadState = (delegate* unmanaged[Cdecl]<PyThreadState*>)GetFunctionByName(nameof(PyGILState_GetThisThreadState), GetUnmanagedDll(_PythonDll));
38-
Py_Main = (delegate* unmanaged[Cdecl]<int, IntPtr, int>)GetFunctionByName(nameof(Py_Main), GetUnmanagedDll(_PythonDll));
3938
PyEval_InitThreads = (delegate* unmanaged[Cdecl]<void>)GetFunctionByName(nameof(PyEval_InitThreads), GetUnmanagedDll(_PythonDll));
4039
PyEval_ThreadsInitialized = (delegate* unmanaged[Cdecl]<int>)GetFunctionByName(nameof(PyEval_ThreadsInitialized), GetUnmanagedDll(_PythonDll));
4140
PyEval_AcquireLock = (delegate* unmanaged[Cdecl]<void>)GetFunctionByName(nameof(PyEval_AcquireLock), GetUnmanagedDll(_PythonDll));
@@ -319,7 +318,6 @@ static Delegates()
319318
internal static delegate* unmanaged[Cdecl]<PyGILState> PyGILState_Ensure { get; }
320319
internal static delegate* unmanaged[Cdecl]<PyGILState, void> PyGILState_Release { get; }
321320
internal static delegate* unmanaged[Cdecl]<PyThreadState*> PyGILState_GetThisThreadState { get; }
322-
internal static delegate* unmanaged[Cdecl]<int, IntPtr, int> Py_Main { get; }
323321
internal static delegate* unmanaged[Cdecl]<void> PyEval_InitThreads { get; }
324322
internal static delegate* unmanaged[Cdecl]<int> PyEval_ThreadsInitialized { get; }
325323
internal static delegate* unmanaged[Cdecl]<void> PyEval_AcquireLock { get; }

src/runtime/Runtime.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -719,20 +719,6 @@ internal static T TryUsingDll<T>(Func<T> op)
719719
internal static PyThreadState* PyGILState_GetThisThreadState() => Delegates.PyGILState_GetThisThreadState();
720720

721721

722-
public static int Py_Main(int argc, string[] argv)
723-
{
724-
var marshaler = StrArrayMarshaler.GetInstance(null);
725-
var argvPtr = marshaler.MarshalManagedToNative(argv);
726-
try
727-
{
728-
return Delegates.Py_Main(argc, argvPtr);
729-
}
730-
finally
731-
{
732-
marshaler.CleanUpNativeData(argvPtr);
733-
}
734-
}
735-
736722
internal static void PyEval_InitThreads() => Delegates.PyEval_InitThreads();
737723

738724

0 commit comments

Comments
 (0)
0