@@ -123,12 +123,6 @@ public class Runtime
123123 /// </summary>
124124 public static OperatingSystemType OperatingSystem { get ; private set ; }
125125
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-
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+ string operatingSystemName = 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 OperatingSystemType OSType ;
378- if ( ! OperatingSystemTypeMapping . TryGetValue ( OperatingSystemName , out OSType ) )
372+ if ( ! OperatingSystemTypeMapping . TryGetValue ( operatingSystemName , out OSType ) )
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 else if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
395388 OperatingSystem = OperatingSystemType . Darwin ;
396389 else if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
397390 OperatingSystem = OperatingSystemType . Windows ;
398-
391+ else
392+ OperatingSystem = OperatingSystemType . Other ;
393+
399394 switch ( RuntimeInformation . ProcessArchitecture )
400395 {
401396 case Architecture . X86 :
0 commit comments