Discover app factory deterministically

Commit 2ae740dd49 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 <nils@redhat.com>
This commit is contained in:
Nils Philippsen 2020-08-13 10:36:46 +02:00
parent 1a9059dd3a
commit cf3089a8f8

View file

@ -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):