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.operating_systems.mac_os import MacOs
|
||||
|
||||
@ -22,6 +22,4 @@ def __init__(self):
|
||||
|
||||
@classmethod
|
||||
def detect(self):
|
||||
platform = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
|
||||
platform, _ = platform.communicate()
|
||||
return 'darwin' in platform.strip().lower()
|
||||
return 'darwin' in platform.system().lower()
|
||||
|
@ -1,4 +1,3 @@
|
||||
import subprocess
|
||||
import platform
|
||||
from spack.architecture import Platform, Target
|
||||
from spack.operating_systems.linux_distro import LinuxDistro
|
||||
@ -27,6 +26,4 @@ def __init__(self):
|
||||
|
||||
@classmethod
|
||||
def detect(self):
|
||||
platform = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
|
||||
platform, _ = platform.communicate()
|
||||
return 'linux' in platform.strip().lower()
|
||||
return 'linux' in platform.system().lower()
|
||||
|
Loading…
Reference in New Issue
Block a user