Use python platform.system for system ID (#1499)
* Rebase and merging using platform.system Rebasing and merging using platform.system instead of uname -a. * Add missing import platform statement * Remove subprocess import Remove ununsed import subprocess to make changes flak8 compliant
This commit is contained in:
parent
4d939802ae
commit
b42dbc01fe
@ -1,4 +1,4 @@
|
|||||||
import subprocess
|
import platform
|
||||||
from spack.architecture import Platform, Target
|
from spack.architecture import Platform, Target
|
||||||
from spack.operating_systems.mac_os import MacOs
|
from spack.operating_systems.mac_os import MacOs
|
||||||
|
|
||||||
@ -22,6 +22,4 @@ def __init__(self):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(self):
|
def detect(self):
|
||||||
platform = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
|
return 'darwin' in platform.system().lower()
|
||||||
platform, _ = platform.communicate()
|
|
||||||
return 'darwin' in platform.strip().lower()
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import subprocess
|
|
||||||
import platform
|
import platform
|
||||||
from spack.architecture import Platform, Target
|
from spack.architecture import Platform, Target
|
||||||
from spack.operating_systems.linux_distro import LinuxDistro
|
from spack.operating_systems.linux_distro import LinuxDistro
|
||||||
@ -27,6 +26,4 @@ def __init__(self):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(self):
|
def detect(self):
|
||||||
platform = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
|
return 'linux' in platform.system().lower()
|
||||||
platform, _ = platform.communicate()
|
|
||||||
return 'linux' in platform.strip().lower()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user