Skip to content
Myr

click detects program name when run as module

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

authored by David Lord · committed by David Lord · parent 64206c1 · Browse files · 2 files+4 added−4 removed
This commit

State

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

Diff stats

2 files+4 added−4 removed

  • other:+4 added−4 removed

2 files+4 added−4 removed

modified:src/flask/__main__.py+1 added-1 removed
1from .cli import main23main(as_module=True)3main()
modified:src/flask/cli.py+3 added-3 removed
951 unmodified lines
952 )953)954955956def main(as_module=False):956def main():957 # TODO omit sys.argv once https://github.com/pallets/click/issues/536 is fixed958 cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)958 cli.main(args=sys.argv[1:])959960961if __name__ == "__main__":962 main(as_module=True)962 main()