Revert wrong changes on temporary_attribute_value
We don't want to ignore any error. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
08b30e8195
commit
4447ac5f1a
@ -34,12 +34,7 @@ def temporary_attribute_value(obj, attribute, value):
|
||||
"""Temporarily switch an object attribute value to another value."""
|
||||
original_value = getattr(obj, attribute)
|
||||
setattr(obj, attribute, value)
|
||||
|
||||
try:
|
||||
yield
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
yield
|
||||
setattr(obj, attribute, original_value)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user