From 937ad10275af3e190dcb63df926812a57d1e3e7e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 12 May 2014 02:16:13 +0200 Subject: [PATCH] Simplified app finding for cli --- flask/cli.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/flask/cli.py b/flask/cli.py index ec8c5ca5..6d393345 100644 --- a/flask/cli.py +++ b/flask/cli.py @@ -39,13 +39,8 @@ def find_best_app(module): matches = [v for k, v in iteritems(module.__dict__) if isinstance(v, Flask)] - if matches: - if len(matches) > 1: - raise NoAppException('More than one possible Flask application ' - 'found in module "%s", none of which are called ' - '"app". Be explicit!' % module.__name__) + if len(matches) == 1: return matches[0] - raise NoAppException('Failed to find application in module "%s". Are ' 'you sure it contains a Flask application? Maybe ' 'you wrapped it in a WSGI middleware or you are '