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

Fix Marshal PythonHome for PY3 · pythonnet/pythonnet@5edcded · GitHub

Repository navigation

Commit 5edcded

Browse files
committed
Fix Marshal PythonHome for PY3
1 parent 403ae6f commit 5edcded

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/runtime/pythonengine.cs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ public static string PythonHome
8585
{
8686
Marshal.FreeHGlobal(_pythonHome);
8787
}
88-
_pythonHome = Marshal.StringToHGlobalAnsi(value);
88+
_pythonHome = Runtime.IsPython3
89+
? UcsMarshaler.GetInstance("").MarshalManagedToNative(value)
90+
: Marshal.StringToHGlobalAnsi(value);
8991
Runtime.Py_SetPythonHome(_pythonHome);
9092
}
9193
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL