Skip to content

Commit

Permalink
Update serve.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson authored Mar 31, 2021
1 parent eb9ffa3 commit 11922fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nikola/plugins/command/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ def _execute(self, options, args):
# Some browsers fail to load 0.0.0.0 (Issue #2755)
if sa[0] == '0.0.0.0':
server_url = "http://127.0.0.1:{1}/".format(*sa)
self.logger.info("Opening {0} in the default web browser...".format(server_url))
pid = os.fork()
if pid == 0:
if getattr(webbrowser.get(), name, "") == "www-browser":
self.logger.info("Unable to open web browser, as Python could only find a terminal browser...")
else:
self.logger.info("Opening {0} in the default web browser...".format(server_url))
webbrowser.open(server_url)
sys.exit(0)
if options['detach']:
self.detached = True
OurHTTPRequestHandler.quiet = True
Expand Down

0 comments on commit 11922fa

Please sign in to comment.