INNER CODE UNIT · Python

setupmethod

michaelzhang-ai/Text2Video · venv_vid2vid/lib/python3.7/site-packages/flask/app.py:82

def setupmethod(f):
    """Wraps a method so that it performs a check in debug mode if the
    first request was already handled.
    """

    def wrapper_func(self, *args, **kwargs):
        if self.debug and self._got_first_request:
            raise AssertionError(
                "A setup function was called after the "
                "first request was handled.  This usually indicates a bug "
                "in the application where a module was not imported "
                "and decorators or other functionality was called too late.\n"
                "To fix this make sure to import all your view modules, "
                "database models and everything related at a central place "
                "before the application starts serving requests."
            )
        return f(self, *args, **kwargs)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…