Skip to content
Myr

Discover app factory deterministically

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Commit 2ae740dd4903bbe5f3864384bcdf2ab2d4638bce probably inadvertently changed to iterate over a set of "create_app", "make_app" to discover application factory functions. As sets don't guarantee order, differences in the implementation of the type can make it non-deterministic which factory function is used if a project implements both. Revert to using a tuple.

authored by Nils Philippsen · committed by Nils Philippsen · parent 1a9059d · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Nils Philippsen <nils@redhat.com>

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/flask/cli.py+1 added-1 removed
58 unmodified lines
59 f" to specify the correct one."60 )6162 # Search for app factory functions.63 for attr_name in {"create_app", "make_app"}:63 for attr_name in ("create_app", "make_app"):64 app_factory = getattr(module, attr_name, None)6566 if inspect.isfunction(app_factory):67 try:
895 unmodified lines