Skip to content

Commit 60d15cd

Browse files
committed
Make setup.py work again
1 parent 946b9a0 commit 60d15cd

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Python.Runtime/runtime.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ public static partial class Runtime
8787

8888
public static int MainManagedThreadId { get; private set; }
8989

90+
#if UCS2 && PYTHON2
91+
static int _UCS = 2;
92+
#else
93+
static int _UCS = 4;
94+
#endif
95+
9096
/// <summary>
9197
/// Encoding to use to convert Unicode to/from Managed to Native
9298
/// </summary>
@@ -223,18 +229,9 @@ internal static void Initialize(bool initSigs = false)
223229
IntPtr dllLocal = IntPtr.Zero;
224230
var loader = LibraryLoader.Get(OperatingSystem);
225231

226-
if (_PythonDll != "__Internal")
227-
{
228-
dllLocal = loader.Load(_PythonDll);
229-
}
230232
_PyObject_NextNotImplemented = loader.GetFunction(dllLocal, "_PyObject_NextNotImplemented");
231233
PyModuleType = loader.GetFunction(dllLocal, "PyModule_Type");
232234

233-
if (dllLocal != IntPtr.Zero)
234-
{
235-
loader.Free(dllLocal);
236-
}
237-
238235
// Initialize modules that depend on the runtime class.
239236
AssemblyManager.Initialize();
240237
PyCLRMetaType = MetaType.Initialize();

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,10 @@ def finalize_options(self):
8888
"Python.Runtime/",
8989
output="pythonnet/dlls",
9090
),
91+
DotnetLib(
92+
"python-runtime-native",
93+
"Python.Runtime.Native/",
94+
output="pythonnet/dlls",
95+
),
9196
},
9297
)

0 commit comments

Comments
 (0)