Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita7949b9

Browse files
committed
Stop exposing Python's MachineName on Runtime
1 parente213a97 commita7949b9

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

‎src/embed_tests/TestRuntime.cs

Lines changed: 0 additions & 2 deletions
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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,6 @@ public class Runtime
154154
/// </summary>
155155
publicstaticMachineTypeMachine{get;privateset;}/* 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-
publicstaticstringMachineName{get;privateset;}
161-
162157
internalstaticboolIsPython2=pyversionnumber<30;
163158
internalstaticboolIsPython3=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+
stringmachineName=GetManagedString(op);
374369
XDecref(op);
375370
XDecref(fn);
376371

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp