def decorated(self):
    old = self.use_all_engines
    self.use_all_engines = True
    try:
        f(self)
    finally:
        self.use_all_engines = old
def decorated(self):
    old = self.use_all_engines
    self.use_all_engines = True
    try:
        f(self)
    finally:
        self.use_all_engines = old