summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Melara <maamelara@gmail.com>2016-06-16 09:44:37 -0700
committerMario Melara <maamelara@gmail.com>2016-06-16 09:44:37 -0700
commit6b037706023c6cc138709d4cbca91d81d32cc4c4 (patch)
tree47a2fe24a79869cc603e0486cd01c0184a5421e9
parent88b73bacdbb8a3254c6e52b6b332e49b00095c37 (diff)
downloadspack-6b037706023c6cc138709d4cbca91d81d32cc4c4.tar.gz
spack-6b037706023c6cc138709d4cbca91d81d32cc4c4.tar.bz2
spack-6b037706023c6cc138709d4cbca91d81d32cc4c4.tar.xz
spack-6b037706023c6cc138709d4cbca91d81d32cc4c4.zip
Added str method to mac_osx so that whenever we try to access darwins different operating systems we can grab the name correctly. This avoids having to worry whether we have a version attached to it or not.
-rw-r--r--lib/spack/spack/operating_systems/mac_osx.py9
-rw-r--r--lib/spack/spack/platforms/darwin.py8
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/spack/spack/operating_systems/mac_osx.py b/lib/spack/spack/operating_systems/mac_osx.py
index a9de03d2cc..3cf9b4e12e 100644
--- a/lib/spack/spack/operating_systems/mac_osx.py
+++ b/lib/spack/spack/operating_systems/mac_osx.py
@@ -21,9 +21,8 @@ class MacOsx(OperatingSystem):
"10.11": "elcapitan"}
mac_ver = py_platform.mac_ver()[0][:-2]
- try:
- name = mac_releases[mac_ver]
- except KeyError:
- name = "mac_os"
-
+ name = mac_releases.get(mac_ver, "mac_osx")
super(MacOsx, self).__init__(name, mac_ver)
+
+ def __str__(self):
+ return self.name
diff --git a/lib/spack/spack/platforms/darwin.py b/lib/spack/spack/platforms/darwin.py
index 7901f82d06..8c8af83d55 100644
--- a/lib/spack/spack/platforms/darwin.py
+++ b/lib/spack/spack/platforms/darwin.py
@@ -13,11 +13,11 @@ class Darwin(Platform):
self.add_target(self.default, Target(self.default))
mac_os = MacOsx()
- self.default_os = mac_os.name
- self.front_os = mac_os.name
- self.back_os = mac_os.name
+ self.default_os = str(mac_os)
+ self.front_os = str(mac_os)
+ self.back_os = str(mac_os)
- self.add_operating_system(mac_os.name, mac_os)
+ self.add_operating_system(str(mac_os), mac_os)
@classmethod
def detect(self):