Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 563f6a6

Browse files
committed
Calculate Runtime fields before Initialization
1 parent 7db41a9 commit 563f6a6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/runtime/runtime.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ public class Runtime
151151
internal static object IsFinalizingLock = new object();
152152
internal static bool IsFinalizing;
153153

154-
internal static bool Is32Bit;
155-
internal static bool IsPython2;
156-
internal static bool IsPython3;
154+
internal static bool Is32Bit = IntPtr.Size == 4;
155+
internal static bool IsPython2 = pyversionnumber < 30;
156+
internal static bool IsPython3 = pyversionnumber >= 30;
157157

158158
/// <summary>
159159
/// Encoding to use to convert Unicode to/from Managed to Native
@@ -165,10 +165,6 @@ public class Runtime
165165
/// </summary>
166166
internal static void Initialize()
167167
{
168-
Is32Bit = IntPtr.Size == 4;
169-
IsPython2 = pyversionnumber < 30;
170-
IsPython3 = pyversionnumber >= 30;
171-
172168
if (Py_IsInitialized() == 0)
173169
{
174170
Py_Initialize();

0 commit comments

Comments
 (0)