def wrap(self, *args, **kwargs): if self._results is None: raise exceptions.Error("Called before `execute`") return f(self, *args, **kwargs)
def wrap(self, *args, **kwargs): if self.closed: raise exceptions.Error( "{klass} already closed".format(klass=self.__class__.__name__) ) return f(self, *args, **kwargs)