Skip to content

Commit f55532c

Browse files
committed
Fix Marshal PythonHome for PY3
1 parent c8f34c4 commit f55532c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runtime/pythonengine.cs

+3-1
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)