ソースを参照

fix `start-server` auto_open_webbrowser no host bug

wangweimin 5 年 前
コミット
e3db50c09b
1 ファイル変更1 行追加1 行削除
  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()