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

Commita406d50

Browse files
committed
Drop OperatingSystemName from the interface as well
1 parenta7949b9 commita406d50

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

‎src/embed_tests/TestRuntime.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public static void PlatformCache()
3030

3131
Assert.That(Runtime.Runtime.Machine,Is.Not.EqualTo(MachineType.Other));
3232
Assert.That(Runtime.Runtime.OperatingSystem,Is.Not.EqualTo(OperatingSystemType.Other));
33-
Assert.That(!string.IsNullOrEmpty(Runtime.Runtime.OperatingSystemName));
3433

3534
// Don't shut down the runtime: if the python engine was initialized
3635
// but not shut down by another test, we'd end up in a bad state.

‎src/runtime/runtime.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ public class Runtime
123123
/// </summary>
124124
publicstaticOperatingSystemTypeOperatingSystem{get;privateset;}
125125

126-
/// <summary>
127-
/// Gets the operating system as reported by python's platform.system().
128-
/// </summary>
129-
publicstaticstringOperatingSystemName{get;privateset;}
130-
131-
132126
/// <summary>
133127
/// Map lower-case version of the python machine name to the processor
134128
/// type. There are aliases, e.g. x86_64 and amd64 are two names for
@@ -359,7 +353,7 @@ private static void InitializePlatformData()
359353

360354
fn=PyObject_GetAttrString(platformModule,"system");
361355
op=PyObject_Call(fn,emptyTuple,IntPtr.Zero);
362-
OperatingSystemName=GetManagedString(op);
356+
stringoperatingSystemName=GetManagedString(op);
363357
XDecref(op);
364358
XDecref(fn);
365359

@@ -375,7 +369,7 @@ private static void InitializePlatformData()
375369
// Now convert the strings into enum values so we can do switch
376370
// statements rather than constant parsing.
377371
OperatingSystemTypeOSType;
378-
if(!OperatingSystemTypeMapping.TryGetValue(OperatingSystemName,outOSType))
372+
if(!OperatingSystemTypeMapping.TryGetValue(operatingSystemName,outOSType))
379373
{
380374
OSType=OperatingSystemType.Other;
381375
}
@@ -388,14 +382,15 @@ private static void InitializePlatformData()
388382
}
389383
Machine=MType;
390384
#else
391-
OperatingSystem=OperatingSystemType.Other;
392385
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
393386
OperatingSystem=OperatingSystemType.Linux;
394387
elseif(RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
395388
OperatingSystem=OperatingSystemType.Darwin;
396389
elseif(RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
397390
OperatingSystem=OperatingSystemType.Windows;
398-
391+
else
392+
OperatingSystem=OperatingSystemType.Other;
393+
399394
switch(RuntimeInformation.ProcessArchitecture)
400395
{
401396
caseArchitecture.X86:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp