Skip to content

Python 3.8 #1138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 16, 2020
Merged
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
Stop exposing Python's MachineName on Runtime
  • Loading branch information
filmor committed May 15, 2020
commit a7949b9ff0d0e3fd6fd64b7fc0b82111dfbaebbb
2 changes: 0 additions & 2 deletions src/embed_tests/TestRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public static void PlatformCache()
Runtime.Runtime.Initialize();

Assert.That(Runtime.Runtime.Machine, Is.Not.EqualTo(MachineType.Other));
Assert.That(!string.IsNullOrEmpty(Runtime.Runtime.MachineName));

Assert.That(Runtime.Runtime.OperatingSystem, Is.Not.EqualTo(OperatingSystemType.Other));
Assert.That(!string.IsNullOrEmpty(Runtime.Runtime.OperatingSystemName));

Expand Down
9 changes: 2 additions & 7 deletions src/runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,6 @@ public class Runtime
/// </summary>
public static MachineType Machine { get; private set; }/* set in Initialize using python's platform.machine */

/// <summary>
/// Gets the machine architecture as reported by python's platform.machine().
/// </summary>
public static string MachineName { get; private set; }

internal static bool IsPython2 = pyversionnumber < 30;
internal static bool IsPython3 = pyversionnumber >= 30;

Expand Down Expand Up @@ -370,7 +365,7 @@ private static void InitializePlatformData()

fn = PyObject_GetAttrString(platformModule, "machine");
op = PyObject_Call(fn, emptyTuple, IntPtr.Zero);
MachineName = GetManagedString(op);
string machineName = GetManagedString(op);
XDecref(op);
XDecref(fn);

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

MachineType MType;
if (!MachineTypeMapping.TryGetValue(MachineName.ToLower(), out MType))
if (!MachineTypeMapping.TryGetValue(machineName.ToLower(), out MType))
{
MType = MachineType.Other;
}
Expand Down