diff options
author | Mario Melara <maamelara@gmail.com> | 2016-04-08 10:29:37 -0700 |
---|---|---|
committer | Mario Melara <maamelara@gmail.com> | 2016-04-08 10:29:37 -0700 |
commit | 0d1a1b7526ce1c129bed352b175f33f2875b8b41 (patch) | |
tree | e41ad84fefd103378aca6da2235122f509744e98 /lib | |
parent | 6ff6c805af2a4626e0611f3798eedd3a6f1b3e06 (diff) | |
download | spack-0d1a1b7526ce1c129bed352b175f33f2875b8b41.tar.gz spack-0d1a1b7526ce1c129bed352b175f33f2875b8b41.tar.bz2 spack-0d1a1b7526ce1c129bed352b175f33f2875b8b41.tar.xz spack-0d1a1b7526ce1c129bed352b175f33f2875b8b41.zip |
Changed _set_architecture so if user inputs only the target, then os is None. This prevents the os being referenced before assignment error
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/spec.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 94d881da28..28cd6a0274 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -461,12 +461,17 @@ class Spec(object): def _set_architecture(self, architecture): """Called by the parser to set the architecture.""" if self.architecture: raise DuplicateArchitectureError( - "Spec for '%s' cannot have two architectures." % self.name) + "Spec for '%s' cannot have two architectures." % self.name) if '-' in architecture: os, target = architecture.split('-') + elif architecture == 'frontend' or architecture == 'backend': os = architecture target = architecture + else: + os = None + target = architecture + self.architecture = spack.architecture.Arch(os, target) |