Skip to content
Myr

#2341: Accept default argument value when args lenght equal 1

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

authored by Junior Báez · committed by Junior Báez · parent 6a8c8c3 · Browse files · 1 file+5 added−2 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+5 added−2 removed

  • other:+5 added−2 removed

1 file+5 added−2 removed

modified:flask/cli.py+5 added-2 removed
85 unmodified lines
86 """Takes an app factory, a ``script_info` object and optionally a tuple87 of arguments. Checks for the existence of a script_info argument and calls88 the app_factory depending on that and the arguments provided.89 """90 arg_names = getargspec(app_factory).args90 args_spec = getargspec(app_factory)91 arg_names = args_spec.args92 arg_defaults = args_spec.defaults9394 if 'script_info' in arg_names:95 return app_factory(*arguments, script_info=script_info)96 elif arguments:97 return app_factory(*arguments)95 elif not arguments and len(arg_names) == 1:98 elif not arguments and len(arg_names) == 1 and arg_defaults is None:99 return app_factory(script_info)100 return app_factory()101102
568 unmodified lines