Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make setup.py work again
  • Loading branch information
filmor committed Dec 17, 2019
commit 60d15cdcf1c8fd67b3138d58da19ef4bcf83a651
15 changes: 6 additions & 9 deletions Python.Runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ public static partial class Runtime

public static int MainManagedThreadId { get; private set; }

#if UCS2 && PYTHON2
static int _UCS = 2;
#else
static int _UCS = 4;
#endif

/// <summary>
/// Encoding to use to convert Unicode to/from Managed to Native
/// </summary>
Expand Down Expand Up @@ -223,18 +229,9 @@ internal static void Initialize(bool initSigs = false)
IntPtr dllLocal = IntPtr.Zero;
var loader = LibraryLoader.Get(OperatingSystem);

if (_PythonDll != "__Internal")
{
dllLocal = loader.Load(_PythonDll);
}
_PyObject_NextNotImplemented = loader.GetFunction(dllLocal, "_PyObject_NextNotImplemented");
PyModuleType = loader.GetFunction(dllLocal, "PyModule_Type");

if (dllLocal != IntPtr.Zero)
{
loader.Free(dllLocal);
}

// Initialize modules that depend on the runtime class.
AssemblyManager.Initialize();
PyCLRMetaType = MetaType.Initialize();
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,10 @@ def finalize_options(self):
"Python.Runtime/",
output="pythonnet/dlls",
),
DotnetLib(
"python-runtime-native",
"Python.Runtime.Native/",
output="pythonnet/dlls",
),
},
)