diff options
-rwxr-xr-x | bin/spack | 2 | ||||
-rw-r--r-- | lib/spack/spack/cmd/compiler.py | 13 | ||||
-rw-r--r-- | lib/spack/spack/config.py | 10 |
3 files changed, 13 insertions, 12 deletions
@@ -152,7 +152,7 @@ def main(): command = spack.cmd.get_command(args.command) try: return_val = command(parser, args) - except SpackError, e: + except SpackError as e: e.die() except KeyboardInterrupt: sys.stderr.write('\n') diff --git a/lib/spack/spack/cmd/compiler.py b/lib/spack/spack/cmd/compiler.py index 3e58e82184..786b3b8eb4 100644 --- a/lib/spack/spack/cmd/compiler.py +++ b/lib/spack/spack/cmd/compiler.py @@ -22,19 +22,18 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -import sys import argparse +import sys import llnl.util.tty as tty -from llnl.util.tty.color import colorize -from llnl.util.tty.colify import colify -from llnl.util.lang import index_by - import spack.compilers -import spack.spec import spack.config -from spack.util.environment import get_path +import spack.spec +from llnl.util.lang import index_by +from llnl.util.tty.colify import colify +from llnl.util.tty.color import colorize from spack.spec import CompilerSpec +from spack.util.environment import get_path description = "Manage compilers" diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index 14e5aaf4fb..336d47cbb7 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -539,14 +539,16 @@ def update_config(section, update_data, scope=None): other yaml-ish structure. """ + validate_section_name(section) # validate section name + scope = validate_scope(scope) # get ConfigScope object from string. + # read in the config to ensure we've got current data - get_config(section) + configuration = get_config(section) - validate_section_name(section) # validate section name - scope = validate_scope(scope) # get ConfigScope object from string. + configuration.update(update_data) # read only the requested section's data. - scope.sections[section] = { section : update_data } + scope.sections[section] = {section: configuration} scope.write_section(section) |