I haven't tested this yet, but there should be bug right now with the decorator.
ContextChange can not be applied twice, so if it is used as a decorator on recursive function, or the function is being called by multiple threads - it should raise an exception the second time it's called (but before the first call was completed).
Possible solution - copy ContextChange instance and apply the copy of it, within the decorated internal function, to make the ContextChange local variable. That should do the trick.
I haven't tested this yet, but there should be bug right now with the decorator.
ContextChange
can not be applied twice, so if it is used as a decorator on recursive function, or the function is being called by multiple threads - it should raise an exception the second time it's called (but before the first call was completed).Possible solution - copy
ContextChange
instance and apply the copy of it, within thedecorated
internal function, to make theContextChange
local variable. That should do the trick.