From 11922fa7dc148e28b8b9e38af1f3714d1996f816 Mon Sep 17 00:00:00 2001 From: Christopher Jefferson Date: Wed, 31 Mar 2021 21:16:45 +0100 Subject: [PATCH] Update serve.py --- nikola/plugins/command/serve.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nikola/plugins/command/serve.py b/nikola/plugins/command/serve.py index 5b110cbf3..aeb352433 100644 --- a/nikola/plugins/command/serve.py +++ b/nikola/plugins/command/serve.py @@ -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