@@ -123,12 +123,6 @@ public class Runtime
123
123
/// </summary>
124
124
public static OperatingSystemType OperatingSystem { get ; private set ; }
125
125
126
- /// <summary>
127
- /// Gets the operating system as reported by python's platform.system().
128
- /// </summary>
129
- public static string OperatingSystemName { get ; private set ; }
130
-
131
-
132
126
/// <summary>
133
127
/// Map lower-case version of the python machine name to the processor
134
128
/// type. There are aliases, e.g. x86_64 and amd64 are two names for
@@ -359,7 +353,7 @@ private static void InitializePlatformData()
359
353
360
354
fn = PyObject_GetAttrString ( platformModule , "system" ) ;
361
355
op = PyObject_Call ( fn , emptyTuple , IntPtr . Zero ) ;
362
- OperatingSystemName = GetManagedString ( op ) ;
356
+ string operatingSystemName = GetManagedString ( op ) ;
363
357
XDecref ( op ) ;
364
358
XDecref ( fn ) ;
365
359
@@ -375,7 +369,7 @@ private static void InitializePlatformData()
375
369
// Now convert the strings into enum values so we can do switch
376
370
// statements rather than constant parsing.
377
371
OperatingSystemType OSType ;
378
- if ( ! OperatingSystemTypeMapping . TryGetValue ( OperatingSystemName , out OSType ) )
372
+ if ( ! OperatingSystemTypeMapping . TryGetValue ( operatingSystemName , out OSType ) )
379
373
{
380
374
OSType = OperatingSystemType . Other ;
381
375
}
@@ -388,14 +382,15 @@ private static void InitializePlatformData()
388
382
}
389
383
Machine = MType ;
390
384
#else
391
- OperatingSystem = OperatingSystemType . Other ;
392
385
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
393
386
OperatingSystem = OperatingSystemType . Linux ;
394
387
else if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
395
388
OperatingSystem = OperatingSystemType . Darwin ;
396
389
else if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
397
390
OperatingSystem = OperatingSystemType . Windows ;
398
-
391
+ else
392
+ OperatingSystem = OperatingSystemType . Other ;
393
+
399
394
switch ( RuntimeInformation . ProcessArchitecture )
400
395
{
401
396
case Architecture . X86 :
0 commit comments