From cf3089a8f82d50430da4cbe690c1ef11d30241ec Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Thu, 13 Aug 2020 10:36:46 +0200 Subject: [PATCH] Discover app factory deterministically 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. Signed-off-by: Nils Philippsen --- src/flask/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flask/cli.py b/src/flask/cli.py index e73f7b78..ba789c29 100644 --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -60,7 +60,7 @@ def find_best_app(script_info, module): ) # Search for app factory functions. - for attr_name in {"create_app", "make_app"}: + for attr_name in ("create_app", "make_app"): app_factory = getattr(module, attr_name, None) if inspect.isfunction(app_factory):