Selaa lähdekoodia

주요 버그 수정 1

잉여개발기 (SPDV) 6 vuotta sitten
vanhempi
sitoutus
80799f7261
1 muutettua tiedostoa jossa 6 lisäystä ja 17 poistoa
  1. 6 17
      app.py

+ 6 - 17
app.py

@@ -730,21 +730,10 @@ app.wsgi_app = werkzeug.debug.DebuggedApplication(app.wsgi_app, True)
 app.debug = True
 
 if __name__ == "__main__":
-    try:
-        http_server = tornado.httpserver.HTTPServer(tornado.wsgi.WSGIContainer(app))
-        http_server.listen(int(server_set['port']), address = server_set['host'])
+    if sys.platform == 'win32' and sys.version_info[0:2] >= (3, 8):
+        asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
 
-        tornado.ioloop.IOLoop.instance().start()
-    except Exception as e:
-        if sys.platform == 'win32':
-            try:
-                asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
-                tornado.ioloop.IOLoop.instance().start()
-            except Exception as e:
-                print('----')
-                print(e)
-                raise
-        else:
-            print('----')
-            print(e)
-            raise
+    http_server = tornado.httpserver.HTTPServer(tornado.wsgi.WSGIContainer(app))
+    http_server.listen(int(server_set['port']), address = server_set['host'])
+
+    tornado.ioloop.IOLoop.instance().start()