Skip to content

Commit 11922fa

Browse files
Update serve.py
1 parent eb9ffa3 commit 11922fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nikola/plugins/command/serve.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ def _execute(self, options, args):
140140
# Some browsers fail to load 0.0.0.0 (Issue #2755)
141141
if sa[0] == '0.0.0.0':
142142
server_url = "http://127.0.0.1:{1}/".format(*sa)
143-
self.logger.info("Opening {0} in the default web browser...".format(server_url))
144-
pid = os.fork()
145-
if pid == 0:
143+
if getattr(webbrowser.get(), name, "") == "www-browser":
144+
self.logger.info("Unable to open web browser, as Python could only find a terminal browser...")
145+
else:
146+
self.logger.info("Opening {0} in the default web browser...".format(server_url))
146147
webbrowser.open(server_url)
147-
sys.exit(0)
148148
if options['detach']:
149149
self.detached = True
150150
OurHTTPRequestHandler.quiet = True

0 commit comments

Comments
 (0)