Skip to content

Commit

Permalink
misc: Bypass update functions in switchconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
ccuetom authored and mloubout committed Aug 4, 2023
1 parent 331f0d2 commit 04487bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions devito/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ def __enter__(self, condition=True, **params):
self.previous = {}
for k, v in self.params.items():
self.previous[k] = configuration[k]
configuration[k] = v
configuration.update(k, v)

def __exit__(self, exc_type, exc_val, exc_tb):
for k, v in self.params.items():
try:
configuration[k] = self.previous[k]
configuration.update(k, self.previous[k])
except ValueError:
# E.g., `platform` and `compiler` will end up here
super(Parameters, configuration).__setitem__(k, self.previous[k])
Expand Down

0 comments on commit 04487bf

Please sign in to comment.