Skip to content

Commit 28d9150

Browse files
committed
Disable running greetings.__main__ as a module; use main()
Allowing `greetings.__main__` to be runnable as a module didn't make much sense, because the `greetings` module itself is already runnable due to the mere existence of the `__main__.py` file. Importing just the `main()` function is likely more common and concise than relying on the heavy-weight `app` object to be callable.
1 parent 231207f commit 28d9150

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

source/guides/creating-command-line-tools.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ so initialize the command-line interface here:
9090

9191
.. code-block:: python
9292
93-
if __name__ == "__main__":
94-
from greetings.cli import app
95-
app()
93+
from greetings.cli import main
94+
95+
main()
9696
9797
.. note::
9898

0 commit comments

Comments
 (0)