summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/platforms/darwin.py6
-rw-r--r--lib/spack/spack/platforms/linux.py5
2 files changed, 3 insertions, 8 deletions
diff --git a/lib/spack/spack/platforms/darwin.py b/lib/spack/spack/platforms/darwin.py
index 974ce3a3f9..ffefd36546 100644
--- a/lib/spack/spack/platforms/darwin.py
+++ b/lib/spack/spack/platforms/darwin.py
@@ -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 @@ class Darwin(Platform):
@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()
diff --git a/lib/spack/spack/platforms/linux.py b/lib/spack/spack/platforms/linux.py
index 38d2cdbfec..cee0cfd6e9 100644
--- a/lib/spack/spack/platforms/linux.py
+++ b/lib/spack/spack/platforms/linux.py
@@ -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 @@ class Linux(Platform):
@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()