Skip to content
Myr

Simplified app finding for cli

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

authored by Armin Ronacher · committed by Armin Ronacher · parent 7321a48 · Browse files · 1 file+1 added−6 removed
This commit

State

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

Diff stats

1 file+1 added−6 removed

  • other:+1 added−6 removed

1 file+1 added−6 removed

modified:flask/cli.py+1 added-6 removed
37 unmodified lines
38 # Otherwise find the only object that is a Flask instance.39 matches = [v for k, v in iteritems(module.__dict__)40 if isinstance(v, Flask)]4142 if matches:43 if len(matches) > 1:42 if len(matches) == 1:44 raise NoAppException('More than one possible Flask application '45 'found in module "%s", none of which are called '46 '"app". Be explicit!' % module.__name__)43 return matches[0]4844 raise NoAppException('Failed to find application in module "%s". Are '45 'you sure it contains a Flask application? Maybe '46 'you wrapped it in a WSGI middleware or you are '47 'using a factory function.' % module.__name__)
401 unmodified lines