Explorar o código

fix `start-server` auto_open_webbrowser no host bug

wangweimin %!s(int64=5) %!d(string=hai) anos
pai
achega
e3db50c09b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      pywebio/platform/tornado.py

+ 1 - 1
pywebio/platform/tornado.py

@@ -124,7 +124,7 @@ def start_server(target, port=0, host='', debug=False,
     handler = webio_handler(target)
     _, port = _setup_server(webio_handler=handler, port=port, host=host, **tornado_app_settings)
     if auto_open_webbrowser:
-        tornado.ioloop.IOLoop.current().spawn_callback(open_webbrowser_on_server_started, host, port)
+        tornado.ioloop.IOLoop.current().spawn_callback(open_webbrowser_on_server_started, host or 'localhost', port)
     tornado.ioloop.IOLoop.current().start()