Skip to content

Commit 424f63c

Browse files
committed
Yet more changes to get it to load properly
1 parent 7c45689 commit 424f63c

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

src/runtime/Python.Runtime.15.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project>
1+
<Project>
22
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
33
<PropertyGroup>
44
<TargetFrameworks>net40;netstandard2.0</TargetFrameworks>
@@ -84,7 +84,7 @@
8484
<DefineConstants Condition="'$(CustomDefineConstants)' == ''">$(DefineConstants);PYTHON2;$(Python2Version);$(PythonWinDefineConstants)</DefineConstants>
8585
</PropertyGroup>
8686
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseWinPY3'">
87-
<DefineConstants Condition="'$(CustomDefineConstants)' == ''">$(DefineConstants);PYTHON3;$(Python3Version);$(PythonWinDefineConstants)</DefineConstants>
87+
<DefineConstants Condition="'$(CustomDefineConstants)' == ''">TRACE;XPLAT;;PYTHON3;PYTHON37;UCS2</DefineConstants>
8888
</PropertyGroup>
8989
<PropertyGroup Condition=" '$(Configuration)' == 'DebugWin'">
9090
<DefineConstants Condition="'$(CustomDefineConstants)' == ''">$(DefineConstants);PYTHON2;$(Python2Version);$(PythonWinDefineConstants);FINALIZER_CHECK;TRACE;DEBUG</DefineConstants>

src/runtime/pythonengine.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,17 @@ public static void Initialize()
167167
Initialize(setSysArgv: true);
168168
}
169169

170-
public static void Initialize(bool setSysArgv = true, bool initSigs = false, ShutdownMode mode = ShutdownMode.Default, bool fromPython = false)
170+
public static void Initialize(bool setSysArgv = true, bool initSigs = false, ShutdownMode mode = ShutdownMode.Reload, bool fromPython = false)
171171
{
172172
Initialize2(Enumerable.Empty<string>(), setSysArgv: setSysArgv, initSigs: initSigs, mode, fromPython: fromPython);
173173
}
174174

175-
public static void Initialize(IEnumerable<string> args, bool setSysArgv = true, bool initSigs = false, ShutdownMode mode = ShutdownMode.Default)
175+
public static void Initialize(IEnumerable<string> args, bool setSysArgv = true, bool initSigs = false, ShutdownMode mode = ShutdownMode.Reload)
176176
{
177177
if (!initialized)
178178
{
179179
InitializeLibrary();
180-
#if !NETSTANDARD
181180
Initialize2(args,setSysArgv, initSigs, ShutdownMode.Reload);
182-
#else
183-
Initialize2(args,setSysArgv, initSigs, ShutdownMode.Normal);
184-
#endif
185-
186181
}
187182
}
188183

@@ -196,7 +191,7 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true,
196191
/// interpreter lock (GIL) to call this method.
197192
/// initSigs can be set to 1 to do default python signal configuration. This will override the way signals are handled by the application.
198193
/// </remarks>
199-
public static void Initialize2(IEnumerable<string> args, bool setSysArgv = true, bool initSigs = false, ShutdownMode mode = ShutdownMode.Default, bool fromPython = false)
194+
public static void Initialize2(IEnumerable<string> args, bool setSysArgv = true, bool initSigs = false, ShutdownMode mode = ShutdownMode.Reload, bool fromPython = false)
200195
{
201196
if (initialized)
202197
{

src/runtime/runtime.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,8 @@ public class Runtime
8181

8282
public static readonly string PythonDLL = _PythonDll;
8383

84-
#if PYTHON_WITHOUT_ENABLE_SHARED && !NETSTANDARD
8584
internal const string _PythonDll = "__Internal";
86-
#else
87-
internal const string _PythonDll = dllBase + dllWithPyDebug + dllWithPyMalloc;
88-
#endif
85+
// internal const string _PythonDll = dllBase + dllWithPyDebug + dllWithPyMalloc;
8986
#if MONO_LINUX
9087
internal const string dllDirectory = "Library/conda/lib/";
9188
internal const string pythonlib = "python3.7m";

0 commit comments

Comments
 (0)