FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix Py_Main for python 3 · pythonnet/pythonnet@6eb59ec · GitHub

Repository navigation

Commit 6eb59ec

Browse files
committed
Fix Py_Main for python 3
1 parent ce0545f commit 6eb59ec

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/runtime/runtime.cs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,17 @@ internal unsafe static extern void
546546
internal unsafe static extern IntPtr
547547
PyGILState_GetThisThreadState();
548548

549+
#if (PYTHON32 || PYTHON33 || PYTHON34)
550+
[DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl,
551+
ExactSpelling=true, CharSet=CharSet.Ansi)]
552+
public unsafe static extern int
553+
Py_Main(int argc, [MarshalAsAttribute(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr)] string[] argv);
554+
#else
549555
[DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl,
550556
ExactSpelling=true, CharSet=CharSet.Ansi)]
551557
public unsafe static extern int
552558
Py_Main(int argc, string[] argv);
559+
#endif
553560

554561
[DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl,
555562
ExactSpelling=true, CharSet=CharSet.Ansi)]

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL