Skip to content

Commit

Permalink
Suppress server shutdown traceback
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Apr 8, 2024
1 parent 07ac9d7 commit 1aa4bd3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sphinx_autobuild/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from sphinx_autobuild import __version__
from sphinx_autobuild.build import Builder
from sphinx_autobuild.filter import IgnoreFilter
from sphinx_autobuild.utils import find_free_port, open_browser
from sphinx_autobuild.utils import find_free_port, open_browser, show


def main():
Expand Down Expand Up @@ -59,7 +59,10 @@ def main():
if args.open_browser:
open_browser(url_host, args.delay)

server.serve(port=port_num, host=host_name, root=out_dir)
try:
server.serve(port=port_num, host=host_name, root=out_dir)
except KeyboardInterrupt:
show(context="Server ceasing operations. Cheerio!")


def _parse_args(argv):
Expand Down

0 comments on commit 1aa4bd3

Please sign in to comment.