Skip to content

Commit a7949b9

Browse files
committed
Stop exposing Python's MachineName on Runtime
1 parent e213a97 commit a7949b9

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/embed_tests/TestRuntime.cs

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ public static void PlatformCache()
2929
Runtime.Runtime.Initialize();
3030

3131
Assert.That(Runtime.Runtime.Machine, Is.Not.EqualTo(MachineType.Other));
32-
Assert.That(!string.IsNullOrEmpty(Runtime.Runtime.MachineName));
33-
3432
Assert.That(Runtime.Runtime.OperatingSystem, Is.Not.EqualTo(OperatingSystemType.Other));
3533
Assert.That(!string.IsNullOrEmpty(Runtime.Runtime.OperatingSystemName));
3634

src/runtime/runtime.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,6 @@ public class Runtime
154154
/// </summary>
155155
public static MachineType Machine { get; private set; }/* set in Initialize using python's platform.machine */
156156

157-
/// <summary>
158-
/// Gets the machine architecture as reported by python's platform.machine().
159-
/// </summary>
160-
public static string MachineName { get; private set; }
161-
162157
internal static bool IsPython2 = pyversionnumber < 30;
163158
internal static bool IsPython3 = pyversionnumber >= 30;
164159

@@ -370,7 +365,7 @@ private static void InitializePlatformData()
370365

371366
fn = PyObject_GetAttrString(platformModule, "machine");
372367
op = PyObject_Call(fn, emptyTuple, IntPtr.Zero);
373-
MachineName = GetManagedString(op);
368+
string machineName = GetManagedString(op);
374369
XDecref(op);
375370
XDecref(fn);
376371

@@ -387,7 +382,7 @@ private static void InitializePlatformData()
387382
OperatingSystem = OSType;
388383

389384
MachineType MType;
390-
if (!MachineTypeMapping.TryGetValue(MachineName.ToLower(), out MType))
385+
if (!MachineTypeMapping.TryGetValue(machineName.ToLower(), out MType))
391386
{
392387
MType = MachineType.Other;
393388
}

0 commit comments

Comments
 (0)