Don't error when removing scope that does not exist

This commit is contained in:
Harmen Stoppels 2021-09-01 14:21:48 +02:00 committed by Todd Gamblin
parent 29d344e4c7
commit de492e73d5

View File

@ -442,7 +442,8 @@ def pop_scope(self):
@_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):