Skip to main content

set_trap

Contextmanager that installs the trap app.

The trap means that anything trying to use the current or default app
will raise an exception.
def set_trap(
app: Flask
) - > contextmanager

Contextmanager that installs the trap app. The trap means that anything trying to use the current or default app will raise an exception.

Parameters​

NameTypeDescription
appFlaskThe application instance to be isolated or replaced by the trap mechanism during the context.

Returns​

TypeDescription
contextmanagerA context manager that yields control while the trap is active and restores the previous application state upon exit.