diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2021-09-01 14:21:48 +0200 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2021-09-03 07:27:19 -0700 |
commit | de492e73d5677a666a50f91d04c5b5dd9c72173a (patch) | |
tree | 72975024e940b35b7c8b6bafd0fd4a43a0c456c5 /lib/spack | |
parent | 29d344e4c72aadb1672a2c8f36f9ff773b636ac4 (diff) | |
download | spack-de492e73d5677a666a50f91d04c5b5dd9c72173a.tar.gz spack-de492e73d5677a666a50f91d04c5b5dd9c72173a.tar.bz2 spack-de492e73d5677a666a50f91d04c5b5dd9c72173a.tar.xz spack-de492e73d5677a666a50f91d04c5b5dd9c72173a.zip |
Don't error when removing scope that does not exist
Diffstat (limited to 'lib/spack')
-rw-r--r-- | lib/spack/spack/config.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index 8df9e514c3..8c69b42d74 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -442,7 +442,8 @@ class Configuration(object): @_config_mutator def remove_scope(self, scope_name): - return self.scopes.pop(scope_name) + """Remove scope by name; has no effect when ``scope_name`` does not exist""" + return self.scopes.pop(scope_name, None) @property def file_scopes(self): |